-
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 labeling of the command palette. #56718
Conversation
Size Change: +57 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
0e10513
to
d1d5cd6
Compare
In the latest commit I'm removing a nested Nested Listboxes are a problem as explained in this comment on the related issue. Also, labeling the nested Listboxes would make things worse. Screenshots from the 'Accessibility Tree view' in Chrome dev tools to illustrate the previous incorrect nesting where the main Listbox contains a mix of options and other Listboxes: After: where the semantic structure is cleaner and more correct: One Listbox that only contains a group and options: |
'aria-label', | ||
__( 'Command suggestions' ) | ||
); | ||
}, [ commandListRef.current ] ); |
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.
Is this really necessary, I'd prefer if we avoid this hack personally. We're updating a DOM node controller by React using an imperative API, this can break in different ways. (For example, if the component is re-rendered, these things could get reset).
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.
@youknowriad Yes I know it's hacky 😞 I reported the root problem upstream at pacocoursey/cmdk#196. If you could maybe help getting the cmdk
team release a fix soon we could entirely avoid this hack
If the upstream issue is holding this back, do you think it would be a good idea to open a new pull request that solves the incorrect nesting separately? |
Yes we can try submit a pull request upstream. |
Together with @carolinan and @SergeyBiryukov we submitted a pull request upstream to solve the labeling issue. See pacocoursey/cmdk#204 I'd propose to wait a few days to see if it gets approved and released timely so that we can update the |
@youknowriad when you have a chance 🙏 do you have any contact at the upstream |
The upstream PR has been merged into the |
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.
Approving this as the upstream fix is taking some time. Let's keep an eye on the package release there and update our code accordingly.
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 Core SVNCore Committers: Use this line as a base for the props when committing in SVN:
GitHub Merge commitsIf 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. |
Thanks Riad. Sure, I just subscribed to get notifications for new Cmdk releases. |
Thanks @afercia btw, check this post for next PRs https://make.wordpress.org/core/2024/02/01/new-commit-message-requirements-in-git-hello-props-bot/ |
Yes sorry I did that in a previous PR and forgot on this one 😞 |
Just wanted you to be aware of it in case you didn't, I don't mind mistakes as we build muscle memory. |
Yes sure, thanks. It's just difficult to get used to, for now 🙂 |
Partially fixes this issue: #54502
What?
Why?
Correct labelling of ARIA widgets and form controls is fundamental for basic accessibility.
How?
Testing Instructions
role="dialog"
is labeledCommand palette
.Search for commands
.role="listbox"
is labeledCommand suggestions
.Testing Instructions for Keyboard
Screenshots or screencast