Skip to content

Commit

Permalink
Ensure menu is closed when blocks are inserted before/after via the m…
Browse files Browse the repository at this point in the history
…enu, help stabilise test
  • Loading branch information
andrewserong committed Sep 8, 2023
1 parent 23d973f commit 615d9f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ export function BlockSettingsDropdown( {
canInsertDefaultBlock
) {
event.preventDefault();
setOpenedBlockSettingsMenu( undefined );
onInsertAfter();
} else if (
isMatch(
Expand All @@ -279,6 +280,7 @@ export function BlockSettingsDropdown( {
canInsertDefaultBlock
) {
event.preventDefault();
setOpenedBlockSettingsMenu( undefined );
onInsertBefore();
}
},
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/specs/editor/various/list-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 615d9f9

Please sign in to comment.