-
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
Prevent distracting focused back button on site editor load #48472
Conversation
box-shadow: none; | ||
outline: none; | ||
} | ||
&:focus-visible:not(:disabled) { |
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.
I wonder at what point we could consider this globally for all buttons and not just this override. cc @ciampo
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.
That would be a nice improvement, and in general I'd be up for bringing it to the source component.
The only challenge would be to make sure that there are no regressions when introducing the change. Button
is a very complex component and it's not easy to grasp the extend of the consequences when making a change.
Would you be able to open a separate issue about this?
Size Change: +103 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Flaky tests detected in 0c107ac. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4280537036
|
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.
Works well! Thanks.
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: 82549ea |
When loading the site editor in trunk, the "back button" is focused initially because the "initial path" of the sidebar is incorrect causing the "Navigator" component to "focus" the screen.
Also, when navigating between screens, the focus style is a bit distracting.
This PR fixes both of these issues by computing the right initial path and by using focus-visible instead of focus.