Font size picker: unexpected change of context when selecting Custom option from select via the keyboard #69029
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Components
/packages/components
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
Observed while working on #69011
When the Font size picker shows more than 5 font sizes, it renders a
CustomSelectControl
instead of aToggleGroup
(the group of buttons with t-shirt sizes).The last option within
CustomSelectControl
is 'Custom'. Actually, this isn't an option to select one of hte provided font sizes. Instead, it's an interactive control to switch the Font size picker to its third UI variant: the UnitControl + RangeControl.Semantically, this is arguable as a select control is supposed to contain values rather than interactive controls that do something.
The main point is about interaction though. While clicking the 'Custom' option with a pointing device or touch may be kinf od an acceptabel interaction, it is not when using the keyboard.
In fact, it is possible to change the selected option in the
CustomSelectControl
even keeping the dropdown closed. By just using the Down or Up arrow keys, the option changes. When reaching the last option 'Custom', the whole UI switches to the third variant, which is totally unexpected in this keyboard interaction scenario. Also, focus is lost.Animated GIF to illustrate mouse and keyboard interaction:
Triggering such an unexpected change of context (the whole UI changes to something entirely different) is also a specific WCAG violation. Not to mention the focus loss.
Step-by-step reproduction instructions
CustomSelectControl
.CustomSelectControl
.CustomSelectControl
. closed and just use the Down arrow key to change the selected option.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: