diff --git a/mu-plugins/blocks/query-filter/src/view.js b/mu-plugins/blocks/query-filter/src/view.js index 7f81f5c7..7d8bba42 100644 --- a/mu-plugins/blocks/query-filter/src/view.js +++ b/mu-plugins/blocks/query-filter/src/view.js @@ -87,6 +87,11 @@ const { actions } = store( 'wporg/query-filter', { }, handleKeydown: ( event ) => { const context = getContext(); + // Only handle key events if the dropdown is open. + if ( ! context.isOpen ) { + return; + } + // If Escape close the dropdown. if ( event.key === 'Escape' ) { actions.closeDropdown();