Revert "fix: close context menu when clicking items with submenus"

This reverts commit 2f93af4d6fdb89ba0773385c646db817ded2bf29.
This commit is contained in:
Elian Doran 2025-09-07 22:57:27 +03:00
parent 22835108be
commit 61ec341c27
No known key found for this signature in database

View File

@ -62,7 +62,7 @@ class ContextMenu {
if (this.isMobile) {
this.$cover.on("click", () => this.hide());
} else {
$(document).on("mouseup", (e) => this.hide());
$(document).on("click", (e) => this.hide());
}
}
@ -225,10 +225,9 @@ class ContextMenu {
$item.on("mouseup", (e) => {
// Prevent submenu from failing to expand on mobile
if (!this.isMobile || !("items" in item && item.items)) {
e.stopPropagation();
// Hide the content menu on mouse up to prevent the mouse event from propagating to the elements below.
if (("command" in item) || ("handler" in item)) {
this.hide();
}
return false;
}
});