-
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
Global styles revisions: move focus and active state to list item #66780
Global styles revisions: move focus and active state to list item #66780
Conversation
…t up to an accessible list item. The result is that the list item is tabbable and selectable via keyboard, and the focus state wraps the entire item.
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @jarekmorawski. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
Size Change: -8 B (0%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
@@ -120,7 +115,7 @@ function RevisionsButtons( { | |||
<ol | |||
className="edit-site-global-styles-screen-revisions__revisions-list" | |||
aria-label={ __( 'Global styles revisions list' ) } | |||
role="group" |
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.
Should we use Composite component here and also improve the revisions list keyboard navigation?
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 the tip, I'll try out the Composite component.
Should we use Composite component here and also improve the revisions list keyboard navigation?
Are those two points mutually exclusive or is the latter a consequence of the former?
I'd like to keep this PR within the scope of #66642.
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.
It can be iterated later, but it would probably change this added code too. It's fine to land this one first.
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.
…rdPress#66780) * This PR removes the button that loads the global revision and moves it up to an accessible list item. The result is that the list item is tabbable and selectable via keyboard, and the focus state wraps the entire item. * Use button border * Fix e2e tests and use composite component Unlinked contributors: jarekmorawski. Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
Fixes #66642
What?
This PR removes the button that loads the global revision and moves it up to an accessible list item.
The result is that the list item is tabbable and selectable via keyboard, and the focus state wraps the entire item.
Thanks to @jarekmorawski for reporting.
Why?
To shift the visible focus to the list item itself, not a child button.
To wrap the select border around the entire item.
See the UI quirk reported by: #66642
How?
Give the ordered list a role of
"listbox"
and the list items,"option"
.Move keyboard/click events to the
<li />
.Testing Instructions
Testing Instructions for Keyboard
Tab through the list items. You should be able to:
2024-11-06.13.30.41.mp4
Screenshots or screencast