From 9bcc0b4edab7b435b0c4af07aaeea4b2cb5220c2 Mon Sep 17 00:00:00 2001 From: tischsoic Date: Tue, 22 Aug 2023 11:09:44 +0200 Subject: [PATCH] fix clickoutside when no branch in MPM --- .../public/js/scripts/core/multilevel.popup.menu.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bundle/Resources/public/js/scripts/core/multilevel.popup.menu.js b/src/bundle/Resources/public/js/scripts/core/multilevel.popup.menu.js index 1a21c153cd..9a09880092 100644 --- a/src/bundle/Resources/public/js/scripts/core/multilevel.popup.menu.js +++ b/src/bundle/Resources/public/js/scripts/core/multilevel.popup.menu.js @@ -363,6 +363,11 @@ handleClickOutside(event) { const topBranch = this.triggerElement.branchElement; + + if (!topBranch) { + return; + } + const closestPopup = event.target.closest('.ibexa-popup-menu'); const isPopupMenuExpanded = !topBranch.classList.contains('ibexa-popup-menu--hidden'); const isClickInsideTrigger = this.triggerElement.contains(event.target);