Skip to content

Commit

Permalink
Make the inserter results panel focusable and improve accessibility. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia authored Jul 2, 2018
1 parent 354756a commit b4435de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion editor/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ export class InserterMenu extends Component {
onChange={ this.onChangeSearchInput }
/>

<div className="editor-inserter__results" ref={ this.inserterResults }>
<div
className="editor-inserter__results"
ref={ this.inserterResults }
tabIndex="0"
role="region"
aria-label={ __( 'Available block types' ) }
>
<InserterResultsPortal.Slot fillProps={ { filterValue } } />

<ChildBlocks
Expand Down
4 changes: 4 additions & 0 deletions editor/components/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ $block-inserter-search-height: 38px;
position: relative;
z-index: 1; // Necessary for the stacked card below parent blocks to show up.

&:focus {
outline: 1px dotted $dark-gray-500;
}

@include break-medium {
height: $block-inserter-content-height + $block-inserter-tabs-height;
}
Expand Down

0 comments on commit b4435de

Please sign in to comment.