From a92604e92f729631fde5668f0a418f14be4d6277 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Sat, 20 Sep 2025 03:09:56 +0300 Subject: [PATCH] client/menus: avoid unnecessary menu item no-column-break grouping --- apps/client/src/menus/context_menu.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/client/src/menus/context_menu.ts b/apps/client/src/menus/context_menu.ts index c9ab89e3f..faef59ad0 100644 --- a/apps/client/src/menus/context_menu.ts +++ b/apps/client/src/menus/context_menu.ts @@ -155,7 +155,7 @@ class ContextMenu { .addClass("show"); } - addItems($parent: JQuery, items: MenuItem[]) { + addItems($parent: JQuery, items: MenuItem[], multicolumn = false) { let $group = $parent; let shouldResetGroup = false; // If true, the next item will be the last one from the group @@ -169,8 +169,8 @@ class ContextMenu { // before and after the seaparator/header. // This is a workaround for Firefox not supporting break-after: avoid on columns. const nextItem = (index < items.length - 1) ? items[index + 1] : null; - if (!shouldResetGroup && nextItem && "kind" in nextItem) { - if (nextItem.kind === "separator" || nextItem.kind === "header") { + if (multicolumn && nextItem && "kind" in nextItem) { + if (!shouldResetGroup && (nextItem.kind === "separator" || nextItem.kind === "header")) { $group = $("