-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 accessibility of the hooked blocks toggles #63133
Conversation
Size Change: -51 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
e9d67a9
to
f2ca994
Compare
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
I'm not sure I agree with the removal of icons here; I think that a) icons don't need to be unique if they are supplemental to visible text, and b) icons can be useful references in supporting people with low literacy in the UI language or with cognitive impairments. The argument that the magnifying glass + the text "search" is going to imply that this will perform a search any more than the word "search" does by itself seems specious; the context should provide sufficient clarity there. The change of order is good; but I'm not totally bought in to the argument that the icons need to be removed to make this happen. |
f2ca994
to
6b8ed15
Compare
Flaky tests detected in 6b8ed15. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10576803424
|
@joedolson I see a point in keeping the icons. Some UIs, for example menus, certainly benefit from using both icons and visible text labels. However, this specific UI is a little different. The toggles need to be on the left. At that point, I'm not sure there's any good spot where the icons can be placed into. The visuals of toggle + icon + visible label wouldn't great, as illustrated in the screenshot below: |
In absence of a new design I'm inclined to merge this PR. @WordPress/gutenberg-design If you have a chance to provide a new design soon that would be welcomed, thanks. The key part is:
|
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.
This works for me.
Fixes #63094
What?
The hooked block toggles aren't accessible, as the visual order and DOM order mismatch.
Additionally, base component should not be overridden with local, ad-hoc custom implementations.
Why?
VIsual order and DOM order must match, when the order affects meaning, oerability and interaction.
Base component should not be overridden: they are designed and tested to provide as much aaccessibility as possible and consistent design.
How?
flex-direction: row-reverse
CSS property that was used to swap the toggle and label position.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before and after: