-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 issues navigation block experiment #50786
Fix accessibility issues navigation block experiment #50786
Conversation
Size Change: +1.15 kB (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
Flaky tests detected in 9441834. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5055745079
|
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've just tested the changes (using WordPress Playground by the way) and all the issues are fixed.
Great work 🙂
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.
Thanks for following up on all of these! Those issues all seem resolved to me.
What?
Fixes the accessibility issues reported related to the navigation block experiment using the Interactivity API:
aria-expanded
Attribute on load #50752Why?
There are some parts that don't have the same behavior as the current block.
How?
Instead of calling
openMenu
whenever the button is clicked I created atoggleMenu
action, that calls open/close depending the status of the menu.aria-expanded
Attribute on load #50752I included the changes made in this pull request to support enumerated attributes that can contain true/false values. Those are mainly the aria attributes and that is the issue we had with
aria-expanded
if I am not mistaken.I moved the
focusout
event to the parent<li>
element so we don't close it until we are outside of the whole submenu. For this to work, we need directives priorities because thecontext
andeffect
have to run before that. Although it is not implemented yet, I tested it and it seems to solve the problem.I believe we can also move the
handleMenuKeydown
, and part of the overlay menu, but I didn't check that. I'll do that once the priorities are ready.Testing Instructions
Follow the testing instructions in the reported issues and ensure they are solved.