Simplify the Inserter accessibility #7058
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR aims to simplify the Inserter accessibility. The Inserter is now based on collapsible accordions and many a11y things were implemented with the previous version in mind. Please refer to the related issue #7052 for more details
Using a list adds an useful information for users: assistive technologies will announce the total number of items in a list and some screen readers will also announce the position of each item. See screenshot below:
Worth noting Safari has a bug (or "feature"?) and doesn't expose styled lists as lists. It needs an explicitly set ARIA role
list
which would trigger a jsx-a11y validation error (while the W3C validator throws just a warning). It's a known Safari bug you can test on this pen: https://codepen.io/afercia/full/WxmJWx/Check the Safari dev tools > "node" tab, and see the styled
ul
has "no matching ARIA roles". Now that Chrome has a nice accessibility tab, you can double check on Chrome and see it correctly exposes the styled list as list. So, it seems Safari-specific.How has this been tested?
npm test
Fixes #7052