Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 45977ef

Browse files
committed
fix(context menu): not auto-closing on mobile
1 parent e1e2afc commit 45977ef

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

apps/client/src/menus/context_menu.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,15 @@ class ContextMenu {
194194
return false;
195195
});
196196

197-
if (!this.isMobile) {
198-
$item.on("mouseup", (e) =>{
197+
$item.on("mouseup", (e) => {
198+
// Prevent submenu from failing to expand on mobile
199+
if (!this.isMobile || !("items" in item && item.items)) {
199200
e.stopPropagation();
200201
// Hide the content menu on mouse up to prevent the mouse event from propagating to the elements below.
201202
this.hide();
202203
return false;
203-
});
204-
}
204+
}
205+
});
205206

206207
if ("enabled" in item && item.enabled !== undefined && !item.enabled) {
207208
$item.addClass("disabled");

apps/client/src/stylesheets/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ body.desktop .dropdown-menu {
391391
}
392392

393393
body.desktop .dropdown-menu:not(#context-menu-container) .dropdown-item,
394-
body.desktop #context-menu-container .dropdown-item > span {
394+
body #context-menu-container .dropdown-item > span {
395395
display: flex;
396396
align-items: center;
397397
}

0 commit comments

Comments
 (0)