Font Library: Focus loss when disabling buttons on the fly #58314
Labels
[Feature] Font Library
[Feature] Typography
Font and typography-related issues and PRs
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Type] Bug
An existing feature does not function as intended
Description
WIthin the Fonts modal dialog, a few buttons get a HTML
disaled
attribute on the fly after they are activated. As such, they become not focusable.While this doesn't impact mouse users, it triggers a focus loss for all keyboard users.
This is the main reason why long time ago we stablished a pattern for such buttons in the editor which follows the pattern suggested in the ARIA Authoring Practices Guidelins:
https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/
Developing a Keyboard Interface
Focusability of disabled controls
aria-disabled
instead.noop
the button.See also ongoing discussion on #56547.
Turns out the buttons within the Fonts modal dialog don't follow this best practice. As such, they're one more case in the editor of buttons disabled on the fly that trigger a focus loss. Cc @ciampo
Worth reminding focus losses are a terrible experience for keyboard users and assistive technology users.
In this specific case, the focus loss is even more serious, as focus lands outside of the modal dialog which is something that should never, ever, happen.
The Animated GIF screencapture below illustrates one of these cases. It happens with other buttons as well so they should all be fixed.
Step-by-step reproduction instructions
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: