-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add close button to the Inserter to improve keyboard a11y #47327
Conversation
Size Change: +118 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
prioritizePatterns={ prioritizePatterns } | ||
selectBlockOnInsert={ selectBlockOnInsert } | ||
/> | ||
<Button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@getdave Do you think you can move this button to appear in the DOM right above the search input? Other than that, this works amazing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at this but the problem is that the Close
button becomes the first focusable element and thus is auto-focused when the inserter opens. This provides poor UX for visual users so we'll need to figure out an alternative visual display for this close UI.
@SaxonF I wonder if you have any thoughts on using a X
close icon on these popovers which we could use consistently across all popovers? Something universal would be better than adding them to all UIs individually.
@@ -639,3 +639,21 @@ $block-inserter-tabs-height: 44px; | |||
height: 100%; | |||
} | |||
} | |||
|
|||
.block-editor-inserter__close.block-editor-inserter__close { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to add to the other ongoing conversation , but I was thinking that it may be good to add a little inline comment here to explain that these styles are meant to visually hide the button (while keeping accessible to assistive technology) unless the button itself is focused.
I have a "noob" question: Shouldn’t all popovers close with ESC with the focus returned to what opened them? Why do we need this invisible close button? Related to this PR, should the close button show not on top of browse all when focused? Thanks @getdave and @alexstine for the work to make the UI more accessible 🙇🏻 |
@draganescu Escape key is not a given. We cannot expect users to know to press escape. |
In order to move this PR forward we will first need to decide if we are prepared to amend the visual design of all popovers to include an always visible close button. If that is possible then we can add it as a default feature of the The approach in this PR won't cut the mustard so I'm going to close it out. |
What?
Adds a focusable (only)
Close
button to the inserter.This is a PoC and can be refined or changed as required based on feedback.
Closes #47016 (comment)
Why?
To ensure there is a clear exit route for keyboard users and users of assistive tech in general.
How?
Adds a button which is only visible once focused.
Testing Instructions
See below.
Testing Instructions for Keyboard
Screenshots or screencast
Screen.Capture.on.2023-01-21.at.15-02-30.mp4