From 2436838aae6f09973a2bbadb7e02b39dd519e3cd Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Tue, 6 May 2025 20:40:13 +0800 Subject: [PATCH] Hide the content menu on mouse up --- apps/client/src/menus/context_menu.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/client/src/menus/context_menu.ts b/apps/client/src/menus/context_menu.ts index ebcdaae91..7d0bc0a2f 100644 --- a/apps/client/src/menus/context_menu.ts +++ b/apps/client/src/menus/context_menu.ts @@ -192,6 +192,12 @@ class ContextMenu { // it's important to stop the propagation especially for sub-menus, otherwise the event // might be handled again by top-level menu return false; + }) + .on("mouseup", (e) =>{ + e.stopPropagation(); + // Hide the content menu on mouse up to prevent the mouse event from propagating to the elements below. + this.hide(); + return false; }); if ("enabled" in item && item.enabled !== undefined && !item.enabled) {