diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:58:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:58:10 +0000 |
commit | 84013b8defc9e0583584f5d41fa9dcb59ca39b0c (patch) | |
tree | 97f1052e81d01558ecc5e05df6dd2d741f0a5574 /wp-includes/blocks/navigation/view.js | |
parent | Adding upstream version 6.5+dfsg1. (diff) | |
download | wordpress-84013b8defc9e0583584f5d41fa9dcb59ca39b0c.tar.xz wordpress-84013b8defc9e0583584f5d41fa9dcb59ca39b0c.zip |
Adding upstream version 6.5.2+dfsg1.upstream/6.5.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | wp-includes/blocks/navigation/view.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/wp-includes/blocks/navigation/view.js b/wp-includes/blocks/navigation/view.js index 8ed1935..553deda 100644 --- a/wp-includes/blocks/navigation/view.js +++ b/wp-includes/blocks/navigation/view.js @@ -151,7 +151,8 @@ const { }, handleMenuFocusout(event) { const { - modal + modal, + type } = (0,interactivity_namespaceObject.getContext)(); // If focus is outside modal, and in the document, close menu // event.target === The element losing focus @@ -160,7 +161,7 @@ const { // `window.document.activeElement` doesn't change. // The event.relatedTarget is null when something outside the navigation menu is clicked. This is only necessary for Safari. - if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement) { + if (event.relatedTarget === null || !modal?.contains(event.relatedTarget) && event.target !== window.document.activeElement && type === 'submenu') { actions.closeMenu('click'); actions.closeMenu('focus'); } |