-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
position: absolute; | ||
top: -999em; | ||
display: block; | ||
background: $white; | ||
width: 100%; | ||
height: ($button-size + $grid-unit-10); | ||
border-radius: 0; | ||
|
||
&:focus, | ||
&:focus-within { | ||
top: auto; | ||
bottom: 0; | ||
} | ||
|
||
} | ||
|
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.