Block toolbar: Invisible tab stop due to scrollable container #57765
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Block editor
/packages/block-editor
[Type] Bug
An existing feature does not function as intended
Description
Spltting this out from #57710 (comment)
Firefox makes scrollable elements focusable. More accurately, there must be two conditions to trigger this Firefox behavior:
auto
orscroll
.auto
value, the element content must trigger an actual content overflow ie. hte content height exceeds the container height.This behavior can be reproduced in the block toolbar, when the 'Top toolbar' is enabled.
Tabbing through the UI with the Tab key, there is an additional 'silent' tab stop compare to other browsers.
Silent tab stops are very confusing for keyboard and assistive technology users. It's a less than ideal experiences that needs to be fixed.
However, the block toolbar is not the only place where this behavior may happen. I think it's worth to revisit all the instanced in the editor where:
overflow
property isauto
orscroll
.overflow-x
oroverflow-y
.This CSS techniques may seem useful at first but they actually introeuce a barriere for users. Specifically about the block toolbar, these lines:
gutenberg/packages/block-editor/src/components/block-toolbar/style.scss
Lines 11 to 13 in cd548af
were added to make the toolbar horizontally scrollable on mobile.
I'm not sure that's a great solution as it doesn't really solve the root problem and it does more harms than good.
Additionally, the height of the content of the toolbar may axceed the toolbar height. In this case, as reported at #57710 tabbing through the block mover buttons triggers a vertical shift of all the other content within the toolbar. Animated GIF to illustrate:
Step-by-step reproduction instructions
Screenshot to illustrate the tab sequence with Chrome:
Screenshot to illustrate the tab sequence with Firefox:
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: