-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native file upload component #1807
base: main
Are you sure you want to change the base?
Conversation
🧪 Review environmenthttps://himtr4theymwmv7ch7jkst6um40ridha.lambda-url.ca-central-1.on.aws/ |
…into a11y/file-buttons
This reverts commit 877b4b8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall. The request branding page still works, although the missing data-testid
will cause the tests to fail so just requesting that you add that back.
@@ -23,7 +23,7 @@ | |||
const input_img = document.querySelector("input.file-upload-field"); | |||
const alt_en = document.getElementById("alt_text_en"); | |||
const alt_fr = document.getElementById("alt_text_fr"); | |||
const message = document.querySelector(".preview .message"); | |||
const message = document.querySelector("#file-description"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const message = document.querySelector("#file-description"); | |
const message = document.getElementById("file-description"); |
{% endif %} | ||
|
||
<div class="form-group"> | ||
{{ form.file(**{ 'class': 'file-upload-field', 'accept': 'image/png', 'data_testid': 'brand_image', 'aria-labelledby': 'file-description', 'data-error-msg': _('You must select a file to continue') }) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to have the data-testid brand_image
for the tests to continue to pass. Unfortunately the tests still arent merged so this would have been easy to miss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add it back. The testid needs to be on the input element?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added testid as file field optional attribute. defaults to test_field-name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed a couple of issues:
- On the branding upload page I am unable to "click" the
File Upload
button with the keyboard both with and without a screen reader. - When using a screen reader the
File Upload
button is not read out
REC-20240529093739.mp4
- On the
Prepare a spreadsheet
page the File upload button cannot be navigated to via the keyboard. - There's some extra hint text showing the mime types / file extensions accepted that I don't see captured in your original screen shots, was this an intentional change?
REC-20240529102806.mp4
Yikes! Thanks Will for spotting these issues.
|
Summary | Résumé
For cds-snc/notification-planning#1229
Fundamentally reconsiders how we do file uploaders.
More native, with a bit of css.
Can't be localized: The browser's default file uploader is sort of a web component, and you can't slot in your own text strings.
At the minimum, lets do some user testing with this PR.
Test instructions | Instructions pour tester la modification
There will be the following visual changes:
Logo before:
Logo after:
Check the following behaviours for Logo form:
Send before:
Send after:
Check the following on the send flow: