-
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
Components: replace TabPanel
with Tabs
in the Style Book
#57287
Conversation
Size Change: +34 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
Flaky tests detected in ac33698. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7280931751
|
ac33698
to
20d14b3
Compare
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.
Code changes LGTM 🚀
One slightly different behavior that I noticed: on trunk
, pressing Tab
while focusing a tab moves focus to the tabpanel, while on this PR focus moves directly to the first focusable element in the tabpanel.
I personally prefer the behaviour in this PR, but we should make sure that there wasn't any particular reason for the previous behavior to justify keeping it around?
This observation threw me a bit, because I'd specifically tried to emulate the existing behavior so I played around with it a bit and I think I understand what's happening (though not entirely why, but that's a question for another day/PR) If you launch the site editor, and immediately open the Global Styles sidebar, followed by the Style Book, Tab will move you to the first/current tab, and then to the first focusable item within the displayed However, if you mess around in the editor and focus a block before opening Global Styles & Style Book, the focus behavior changes. Tab still starts by landing on the currently selected tab, but then cycles through various other elements instead of moving directly into the While this feels off, and I'm not sure what causes it, the behavior seems consistent between |
What?
Replaces the legacy TabPanel component with the new Tabs component.
Why?
Part of the work outlined in #52997
How?
TabPanel
is replaced byTabs
and its sub-components.Testing Instructions
Testing Instructions for Keyboard