From 8e6ea87754f6ebc16b862bb66817a3ca42ebbfef Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 14 Dec 2025 12:02:40 +0200 Subject: [PATCH] fix(context_menu): regressions on mobile --- apps/client/src/stylesheets/style.css | 7 +++++-- apps/client/src/stylesheets/theme-next/base.css | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index 0a1971f11..8ecd85b69 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -1315,13 +1315,16 @@ body.desktop li.dropdown-submenu:hover > ul.dropdown-menu { top: 0; inset-inline-start: calc(100% - 2px); /* -2px, otherwise there's a small gap between menu and submenu where the hover can disappear */ margin-top: -10px; - min-width: max-content; - max-width: 300px; /* to make submenu scrollable https://github.com/zadam/trilium/issues/3136 */ max-height: 600px; overflow: auto; } +body.desktop .dropdown-submenu > .dropdown-menu { + min-width: max-content; + max-width: 300px; +} + .dropdown-submenu.dropstart > .dropdown-menu { inset-inline-start: auto; inset-inline-end: calc(100% - 2px); diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.css index 78d432f19..e210b8d12 100644 --- a/apps/client/src/stylesheets/theme-next/base.css +++ b/apps/client/src/stylesheets/theme-next/base.css @@ -176,7 +176,7 @@ body.desktop .dropdown-submenu .dropdown-menu { cursor: default !important; } -.dropdown-menu:has(> .dropdown-submenu.dropstart) > .dropdown-item { +body.desktop .dropdown-menu:has(> .dropdown-submenu.dropstart) > .dropdown-item { padding-inline-end: var(--menu-item-start-padding) !important; padding-inline-start: var(--menu-item-end-padding) !important; } @@ -254,7 +254,8 @@ html body .dropdown-item[disabled] { } /* Menu item arrow */ -.dropdown-submenu:not(.dropstart) .dropdown-toggle::after { +body.mobile .dropdown-submenu .dropdown-toggle::after, +body.desktop .dropdown-submenu:not(.dropstart) .dropdown-toggle::after { content: "\ed3b" !important; position: absolute; display: flex !important; @@ -270,7 +271,11 @@ html body .dropdown-item[disabled] { color: var(--menu-item-arrow-color) !important; } -.dropdown-submenu.dropstart .dropdown-toggle::before { +body.mobile .dropdown-submenu.dropstart .dropdown-toggle::before { + content: unset; +} + +body.desktop .dropdown-submenu.dropstart .dropdown-toggle::before { content: "\ea4d" !important; position: absolute; display: flex !important;