Prevent distracting focused back button on site editor load#48472
Prevent distracting focused back button on site editor load#48472youknowriad merged 1 commit intotrunkfrom
Conversation
| box-shadow: none; | ||
| outline: none; | ||
| } | ||
| &:focus-visible:not(:disabled) { |
There was a problem hiding this comment.
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.
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
|
|
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.