diff --git a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js index 01d78c49814c8c..ac72c55836f748 100644 --- a/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js +++ b/packages/block-editor/src/components/block-settings-menu/block-settings-dropdown.js @@ -270,6 +270,7 @@ export function BlockSettingsDropdown( { canInsertDefaultBlock ) { event.preventDefault(); + setOpenedBlockSettingsMenu( undefined ); onInsertAfter(); } else if ( isMatch( @@ -279,6 +280,7 @@ export function BlockSettingsDropdown( { canInsertDefaultBlock ) { event.preventDefault(); + setOpenedBlockSettingsMenu( undefined ); onInsertBefore(); } }, diff --git a/test/e2e/specs/editor/various/list-view.spec.js b/test/e2e/specs/editor/various/list-view.spec.js index 130bd9b7952fde..e0ac030d1fd24b 100644 --- a/test/e2e/specs/editor/various/list-view.spec.js +++ b/test/e2e/specs/editor/various/list-view.spec.js @@ -784,6 +784,10 @@ test.describe( 'List View', () => { ).toBeHidden(); await optionsForFileToggle.click(); + await expect( + optionsForFileMenu, + 'Pressing Space should also open the menu dropdown' + ).toBeVisible(); await pageUtils.pressKeys( 'access+z' ); // Keyboard shortcut for Delete. await expect .poll(