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

CustomSelect: disable virtualFocus to fix issue for screenreaders #58585

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

brookewp
Copy link
Contributor

@brookewp brookewp commented Feb 2, 2024

What?

@afercia pointed out an issue in Safari for screenreaders, where multi-selection has incorrect announcements:

#55023 (comment)

Why?

Unfortunately, it appears it still hasn't been resolved in Safari, so in preparation for the component to be utilized (#57902), we should have a working solution.

How?

@diegohaz shared this is a bug in Safari and a solution to use in the meantime: #55023 (comment)

Safari has known issues with aria-activedescendant. It appears the issue is being addressed for combobox widgets in the upcoming version. So, we can expect improvements in the near future.

For now, the aria-activedescendant can be disabled for the Ariakit Select component by setting the virtualFocus prop to false. This will enable the use of the roving tabindex approach, which seems to function well on Safari.

Testing Instructions

  1. npm run:storybook dev
  2. While using a screen reader, open the select for the 'Multiselect' story.
  3. Ensure it announces the names of unselected items, rather than saying they are selected
Before After
Screenshot 2024-02-01 at 5 31 46 PM Screenshot 2024-02-01 at 5 32 32 PM

@brookewp brookewp added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components labels Feb 2, 2024
@brookewp brookewp requested a review from a team February 2, 2024 01:39
@brookewp brookewp self-assigned this Feb 2, 2024
Copy link

github-actions bot commented Feb 2, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core SVN

If you're a Core Committer, use this list when committing to wordpress-develop in SVN:

Props: brookemk, 0mirka00, hazdiego.

GitHub Merge commits

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: brookewp <brookemk@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: diegohaz <hazdiego@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Confirmed working in Safari 👍

Unfortunately I'm still seeing unreliable announcements with VoiceOver on Firefox. It happens regardless of the changes in this PR, so I think we can still land it as an incremental improvement.

@mirka mirka added [Type] Bug An existing feature does not function as intended Browser Issues Issues or PRs that are related to browser specific problems labels Feb 3, 2024
@diegohaz
Copy link
Member

diegohaz commented Feb 3, 2024

Unfortunately I'm still seeing unreliable announcements with VoiceOver on Firefox. It happens regardless of the changes in this PR, so I think we can still land it as an incremental improvement.

Just to pile on a bit more info, according to the latest WebAIM survey, the VoiceOver/Firefox combo is quite uncommon. It doesn't even make the list.

@brookewp brookewp force-pushed the fix/customselect-multiselect-screenreader branch from 756bf2b to dfbf8ba Compare February 5, 2024 20:38
@brookewp brookewp merged commit 8598549 into trunk Feb 5, 2024
57 checks passed
@brookewp brookewp deleted the fix/customselect-multiselect-screenreader branch February 5, 2024 22:30
@github-actions github-actions bot added this to the Gutenberg 17.7 milestone Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants