Sidebar Tabs: Set default tab to first available#45998
Merged
aaronrobertshaw merged 1 commit intoNov 25, 2022
Merged
Conversation
|
|
|
Size Change: +25 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
alexstine
approved these changes
Nov 23, 2022
alexstine
left a comment
Contributor
There was a problem hiding this comment.
Yes, this would actually be good for A11Y in my opinion. Nice enhancement.
Base automatically changed from
try/conditionally-display-sidebar-tabs
to
trunk
November 25, 2022 05:19
28abcce to
2e33a93
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
TabPanelin 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