Consider to implement a generic "constrain tabbing" functionality #4621
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
This was mentioned here and there in several other issues but, as far as I know, a specific issue hasn't been created yet. So, there it is.
Some Gutenberg UI components work, more or less, like a "modal". They open a floating panel that is visually placed close to the control that opened it, but actually they're placed in the source very far from it.
There are now a few components to set initial focus, move focus back to the "opener" control, get all the tabbable and focusable element, etc. and they're all very useful components to handle focus in a proper way. However, as far as I know, there's no generic component to constrain tabbing yet.
Some components implement their individual way to constrain tabbing, but other components would need the same feature. Consider for example the Contente Structure
Popover
:When it opens, it's possible to tab through its focusable elements. However, it's also possible to "tab away" from it and, since it's placed at the end of the source, tabbing away from it leads users to the end of the page. Basically, the whole interfaces gets "skipped".
This kind of components should be treated like a sort of "modal" and, at the very least, tabbing should be constrained within the component. Maybe worth considering a generic higher order utility component for this?
The text was updated successfully, but these errors were encountered: