Skip to content
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

fix: add aria-label for removing attachment in new request form #543

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

gosiexon-zen
Copy link
Contributor

@gosiexon-zen gosiexon-zen commented Nov 14, 2024

Description

Added aria-label with information how to remove the attachment while navigating with keyboard.
This A11y issue was reported here: GG-3796
Here is also explanation why we don't make the remove button accessible by tab navigation: https://zendesk.atlassian.net/browse/GG-3796?focusedCommentId=2055655

Screenshots

Checklist

  • 📗 all commit messages follow the conventional commits standard
  • ⬅️ changes are compatible with RTL direction
  • ♿ Changes to the UI are tested for accessibility and compliant with WCAG 2.1.
  • 📝 changes are tested in Chrome, Firefox, Safari and Edge
  • 📱 changes are responsive and tested in mobile
  • 👍 PR is approved by @zendesk/vikings

Copy link

@kubraokcu kubraokcu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼🙌🏼🌐

@kubraokcu kubraokcu added the g11n-approved Commented by Globalization label label Nov 14, 2024
@jgorfine-zendesk jgorfine-zendesk requested a review from a team November 18, 2024 17:08
Copy link
Contributor

@Fredx87 Fredx87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a couple of comments, and we also need to wrap the FileListItem components with the FileList component here as shown in the Garden examples: https://66bcf1412f3b1af56ce3fee1--zendeskgarden.netlify.app/components/file-upload#files

<File type="generic" title={fileName} onKeyDown={handleFileKeyDown}>
<File
type="generic"
title={fileName}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need this title anymore

title={fileName}
tabIndex={0}
aria-label={t(
"new-request-form.attachemnts.file",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: there is a typo in the key (attachemnts)

Copy link
Contributor

@jgorfine-zendesk jgorfine-zendesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gosiexon-zen, thanks so much for making this change. I just tested it out in my local Guide instance, and I believe it's working as expected:

Screen.Recording.2024-11-20.at.3.35.57.PM.mov

Is there any chance we could update the "Remove file" button (line 74 of FileListItem.tsx) so it includes the file name, like the label for the group does? That way, if a screen reader user uploads multiple files, they'll be able to tell the "Remove" buttons apart, when navigating the page via form controls.

  • Current behavior: "Remove file"
  • Preferred behavior: "Remove file: {{fileName}}"

@gosiexon-zen gosiexon-zen force-pushed the mbien/attachments-a11y-issue branch from 452cc68 to 7f7e667 Compare November 22, 2024 12:09
@gosiexon-zen gosiexon-zen force-pushed the mbien/attachments-a11y-issue branch from 7f7e667 to 42b503d Compare November 22, 2024 12:11
@gosiexon-zen
Copy link
Contributor Author

Hi @jgorfine-zendesk I applied your suggestions, but I think there should be Stop uploading {{fileName}} for the removing of the currently uploading files and Remove file: {{fileName}} for those which are already uploaded. Let me know if it is ok.

@gosiexon-zen gosiexon-zen force-pushed the mbien/attachments-a11y-issue branch 2 times, most recently from 1cd913c to 57c4458 Compare November 22, 2024 13:07
Copy link

@kubraokcu kubraokcu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reapproving 👍🏼🌐

Copy link
Contributor

@jgorfine-zendesk jgorfine-zendesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gosiexon-zen, I've requested a couple more small changes, but, after that, we should be good to go. 🙂 (I'm approving this PR anyway because the requested changes are more of a nice-to-have than a must-have.)

Here's the current screen reader experience on VoiceOver x Safari:

Screen.Recording.2024-11-22.at.3.32.22.PM.mov

Comment on lines +102 to +107
aria-label={t(
"new-request-form.attachments.remove-file-arria-label",
"Remove file: {{fileName}}",
{ fileName }
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please add aria-describedby={undefined} here? That way, the screen reader won't read out the "Remove file" text from the tooltip after it reads out the name of the button.

Suggested change
aria-label={t(
"new-request-form.attachments.remove-file-arria-label",
"Remove file: {{fileName}}",
{ fileName }
)}
aria-label={t(
"new-request-form.attachments.remove-file-arria-label",
"Remove file: {{fileName}}",
{ fileName }
)}
aria-describedby={undefined}
  • Current screen reader announcement: Remove file: [file name], Remove file, button
  • Expected screen reader announcement: Remove file: [file name], button

(The word "button" comes from it being an HTML button element.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I applied suggestion

Comment on lines +73 to +77
aria-label={t(
"new-request-form.attachments.stop-upload-aria-label",
"Stop uploading {{fileName}}",
{ fileName }
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please add aria-describedby={undefined} to avoid a duplicate screen reader announcement here, too?

Suggested change
aria-label={t(
"new-request-form.attachments.stop-upload-aria-label",
"Stop uploading {{fileName}}",
{ fileName }
)}
aria-label={t(
"new-request-form.attachments.stop-upload-aria-label",
"Stop uploading {{fileName}}",
{ fileName }
)}
aria-describedby={undefined}
  • Current screen reader announcement: Stop uploading [file name], Stop uploading, button
  • Expected screen reader announcement: Stop uploading [file name], button

(The word "button" comes from it being an HTML button element.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I applied suggestion

@gosiexon-zen gosiexon-zen force-pushed the mbien/attachments-a11y-issue branch from 57c4458 to 6127e57 Compare November 25, 2024 12:01
@gosiexon-zen gosiexon-zen merged commit dd60aeb into master Nov 25, 2024
5 checks passed
@gosiexon-zen gosiexon-zen deleted the mbien/attachments-a11y-issue branch November 25, 2024 13:10
@zd-svc-github-copenhagen-theme
Copy link
Collaborator

🎉 This PR is included in version 4.2.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
g11n-approved Commented by Globalization label released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants