Skip to content

Build your personal knowledge base with Trilium Notes

fix(attributes): let the type menu open past the popup edge

Elian Doran45df4890c87d
diff --git a/apps/client/src/widgets/attribute_widgets/attribute_detail.css b/apps/client/src/widgets/attribute_widgets/attribute_detail.css
index 17a3a166a5..352742fe06 100644
--- a/apps/client/src/widgets/attribute_widgets/attribute_detail.css
+++ b/apps/client/src/widgets/attribute_widgets/attribute_detail.css
@@ -20,6 +20,15 @@
contain: none;
}
+/* The type menu is portaled to `document.body` (see the Dropdown's `portalToBody`): the popup is a
+ scroll container (`overflow: auto` above), so an inline menu could only open by scrolling the form
+ under itself. In body it competes with the popup in the root stacking context, where the global
+ dropdown z-index (999) loses to the popup's 1060 — raise it above the popup, staying below the
+ confirmations and prompts (2000) the popup summons. */
+body > div.attr-input-label-type > .dropdown-menu {
+ --bs-dropdown-zindex: 1100;
+}
+
/*
* The same mark the name completion puts against a system name, and so the same colour: quiet, because
* it tells the reader whose name this is rather than asking anything of them. Without a `--color` the
diff --git a/apps/client/src/widgets/attribute_widgets/attribute_detail.tsx b/apps/client/src/widgets/attribute_widgets/attribute_detail.tsx
index 285db4176c..b7a54237eb 100644
--- a/apps/client/src/widgets/attribute_widgets/attribute_detail.tsx
+++ b/apps/client/src/widgets/attribute_widgets/attribute_detail.tsx
@@ -556,6 +556,9 @@ export function AttributeForm({ opts, attrType: initialAttrType, currentNoteId,
<OptionsRow name="attr-label-type" label={t("attribute_detail.label_type")}>
<FormDropdownList
className="attr-input-label-type"
+ // The popup is a scroll container, so an inline menu could only grow by
+ // scrolling the form under itself — and the type list only gets longer.
+ portalToBody
values={DEFINITION_TYPES}
keyProperty="value"
titleProperty="title"