mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
fix: close context menu when clicking items with submenus
This commit is contained in:
parent
7f3c34178b
commit
2f93af4d6f
@ -62,7 +62,7 @@ class ContextMenu {
|
||||
if (this.isMobile) {
|
||||
this.$cover.on("click", () => this.hide());
|
||||
} else {
|
||||
$(document).on("click", (e) => this.hide());
|
||||
$(document).on("mouseup", (e) => this.hide());
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,9 +225,10 @@ 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;
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user