-
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
Sidebar Tabs: Set default tab to first available #45998
Merged
aaronrobertshaw
merged 1 commit into
trunk
from
try/reset-selected-tab-on-selection-change
Nov 25, 2022
Merged
Sidebar Tabs: Set default tab to first available #45998
aaronrobertshaw
merged 1 commit into
trunk
from
try/reset-selected-tab-on-selection-change
Nov 25, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aaronrobertshaw
added
[Type] Enhancement
A suggestion for improvement.
[Feature] Inspector Controls
The interface showing block settings and the controls available for each block
[Package] Block editor
/packages/block-editor
labels
Nov 23, 2022
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: +25 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
alexstine
approved these changes
Nov 23, 2022
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.
Yes, this would actually be good for A11Y in my opinion. Nice enhancement.
alexstine
added
the
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
label
Nov 23, 2022
Base automatically changed from
try/conditionally-display-sidebar-tabs
to
trunk
November 25, 2022 05:19
aaronrobertshaw
force-pushed
the
try/reset-selected-tab-on-selection-change
branch
from
November 25, 2022 05:27
28abcce
to
2e33a93
Compare
aaronrobertshaw
deleted the
try/reset-selected-tab-on-selection-change
branch
November 25, 2022 06:03
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Inspector Controls
The interface showing block settings and the controls available for each block
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Block editor
/packages/block-editor
[Type] Enhancement
A suggestion for improvement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related:
What?
Makes the block inspector sidebar tabs default to the first available tab when changing block selection.
Why?
Before this PR, the
TabPanel
in the sidebar is mounted and then only rerendered when the block selection changes. This means the currently selected tab in its internal state is maintained across blocks.It's a nicer UX for the selected tab to default to the first tab after changing blocks. This helps ensure the most relevant controls, and those most sort after by users are the ones shown by default.
How?
clientId
. As the block selection is already changing, we shouldn't suffer any a11y issues around a loss of focus here. More than happy to receive suggestions on a better approach, though.Testing Instructions
Example block code
Screenshots or screencast
Screen.Recording.2022-11-23.at.7.18.09.pm.mp4