Skip to content

Build your personal knowledge base with Trilium Notes

fix(menus): pad popups under the legacy theme as their scrollers expect

Elian Doran4806a43e6ef0
diff --git a/apps/client/src/widgets/react/Menu.css b/apps/client/src/widgets/react/Menu.css
index 984af93da6..245e55e19d 100644
--- a/apps/client/src/widgets/react/Menu.css
+++ b/apps/client/src/widgets/react/Menu.css
@@ -53,7 +53,6 @@ body.desktop .dropdown-submenu > .dropdown-menu.tn-menu.tn-menu-immediate {
.tn-menu-page,
.tn-menu-filterable {
- --tn-popup-padding: var(--padding, var(--menu-padding-size));
display: flex;
flex-direction: column;
flex: 1 1 auto;
diff --git a/apps/client/src/widgets/react/Popup.css b/apps/client/src/widgets/react/Popup.css
index bbea574850..80448c49f2 100644
--- a/apps/client/src/widgets/react/Popup.css
+++ b/apps/client/src/widgets/react/Popup.css
@@ -143,17 +143,24 @@ body[dir=rtl] .tn-popup[data-reveal]:is([data-reveal="bottom-end"], [data-reveal
flex-direction: column;
}
+/*
+ * The frame's padding, which the scrollers and menu pages inside it reach past. The theme's
+ * `.dropdown-menu:not(.static)` rule sets the same value; Bootstrap's covers a theme that sets none.
+ */
+.dropdown-menu:has(> :is(.tn-menu-scroll, .tn-menu-filterable, .tn-menu-page, .tn-panel-scroll)) {
+ --tn-popup-padding: var(--padding, var(--menu-padding-size, var(--bs-dropdown-padding-y)));
+ padding: var(--tn-popup-padding);
+}
+
.tn-menu-scroll,
.tn-panel-scroll {
- /* Matches the frame's own padding in the theme's `.dropdown-menu:not(.static)` rule. */
- --tn-popup-padding: var(--padding, var(--menu-padding-size));
flex: 1 1 auto;
min-height: 0;
/*
* Spans the frame's padding, so the content scrolls up to its edge instead of being cut off
* inside it, and the separator and header lines, which the theme draws that far past a row,
- * stay inside the scroller instead of scrolling it sideways. Without the theme's variables
- * both fall back to 0, as that theme's menu has no padding.
+ * stay inside the scroller instead of scrolling it sideways. Outside a `.dropdown-menu`, as in
+ * a host's suggestion list, `--tn-popup-padding` is unset and both fall back to 0.
*/
margin: calc(0px - var(--tn-popup-padding));
padding: var(--tn-popup-padding);