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);