summaryrefslogtreecommitdiffstats
path: root/wp-includes/blocks/navigation/view.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:58:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:58:10 +0000
commit84013b8defc9e0583584f5d41fa9dcb59ca39b0c (patch)
tree97f1052e81d01558ecc5e05df6dd2d741f0a5574 /wp-includes/blocks/navigation/view.js
parentAdding upstream version 6.5+dfsg1. (diff)
downloadwordpress-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.js5
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');
}