diff --git a/packages/block-library/src/navigation-link/edit.js b/packages/block-library/src/navigation-link/edit.js index e091b52c68a5c4..bc772671219fe9 100644 --- a/packages/block-library/src/navigation-link/edit.js +++ b/packages/block-library/src/navigation-link/edit.js @@ -333,6 +333,7 @@ export default function NavigationLinkEdit( { isKeyboardEvent.primary( event, 'k' ) || ( ( ! url || isDraft || isInvalid ) && event.keyCode === ENTER ) ) { + event.preventDefault(); setIsLinkOpen( true ); } } diff --git a/packages/block-library/src/navigation-submenu/edit.js b/packages/block-library/src/navigation-submenu/edit.js index 507ea64940c3a6..401d9512797b09 100644 --- a/packages/block-library/src/navigation-submenu/edit.js +++ b/packages/block-library/src/navigation-submenu/edit.js @@ -279,6 +279,7 @@ export default function NavigationSubmenuEdit( { function onKeyDown( event ) { if ( isKeyboardEvent.primary( event, 'k' ) ) { + event.preventDefault(); setIsLinkOpen( true ); } }