fix: Improve event target checking for popup tracking elements

This commit is contained in:
mr. M
2024-11-08 18:17:40 +01:00
parent aa5a768ef0
commit 86a3ad4b1f

View File

@@ -49,7 +49,7 @@ var gZenUIManager = {
for (const el of this._popupTrackingElements) { for (const el of this._popupTrackingElements) {
// target may be inside a shadow root, not directly under the element // target may be inside a shadow root, not directly under the element
// we also ignore menus inside panels // we also ignore menus inside panels
if (!el.contains(showEvent.explicitOriginalTarget) || (showEvent.explicitOriginalTarget && showEvent.explicitOriginalTarget?.closest('panel'))) { if (!el.contains(showEvent.explicitOriginalTarget) || (showEvent.explicitOriginalTarget instanceof Element && showEvent.explicitOriginalTarget?.closest('panel'))) {
continue; continue;
} }
document.removeEventListener('mousemove', this.__removeHasPopupAttribute); document.removeEventListener('mousemove', this.__removeHasPopupAttribute);