Skip to content

Commit

Permalink
Inserter: Preserve autofocus behavior of inserter
Browse files Browse the repository at this point in the history
Even on click, which no longer shifts focus as of 621631ca
  • Loading branch information
aduth committed Mar 7, 2018
1 parent 8f715e0 commit b65d951
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions editor/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ export class InserterMenu extends Component {
const { selectedItem } = this.state;
const isSearching = this.state.filterValue;

// Disable reason: The inserter menu is a modal display, not one which
// is always visible, and one which already incurs this behavior of
// autoFocus via Popover's focusOnMount.

/* eslint-disable jsx-a11y/no-autofocus */
return (
<TabbableContainer
className="editor-inserter__menu"
Expand All @@ -285,6 +290,7 @@ export class InserterMenu extends Component {
placeholder={ __( 'Search for a block' ) }
className="editor-inserter__search"
onChange={ this.filter }
autoFocus
/>
{ ! isSearching &&
<TabPanel className="editor-inserter__tabs" activeClass="is-active"
Expand Down Expand Up @@ -329,6 +335,7 @@ export class InserterMenu extends Component {
}
</TabbableContainer>
);
/* eslint-enable jsx-a11y/no-autofocus */
}
}

Expand Down

0 comments on commit b65d951

Please sign in to comment.