Skip to content

Build your personal knowledge base with Trilium Notes

fix(quick-edit): fade content under the title

Elian Doran8f1889ec94bf
diff --git a/apps/client/src/widgets/dialogs/PopupEditor.css b/apps/client/src/widgets/dialogs/PopupEditor.css
index 4b5f9fb790..7f6738bbd1 100644
--- a/apps/client/src/widgets/dialogs/PopupEditor.css
+++ b/apps/client/src/widgets/dialogs/PopupEditor.css
@@ -107,6 +107,13 @@ body.mobile .modal.popup-editor-dialog .modal-dialog {
flex-direction: column;
}
+/* Fades the content at the top edge instead of clipping it; the padding keeps the first line
+ clear at rest. */
+body.mobile .modal.popup-editor-dialog .popup-editor-scroll {
+ --scroll-fade-top: 16px;
+ padding-top: var(--scroll-fade-top);
+}
+
.modal.popup-editor-dialog .title-row,
.modal.popup-editor-dialog .modal-title,
.modal.popup-editor-dialog .note-icon-widget,
diff --git a/apps/client/src/widgets/dialogs/PopupEditor.spec.tsx b/apps/client/src/widgets/dialogs/PopupEditor.spec.tsx
index b000ad8204..eafd9622f4 100644
--- a/apps/client/src/widgets/dialogs/PopupEditor.spec.tsx
+++ b/apps/client/src/widgets/dialogs/PopupEditor.spec.tsx
@@ -505,6 +505,7 @@ describe("PopupEditor", () => {
it("gives mobile its own toolbar and hides the buttons that make no sense in a popup", async () => {
expect(container.querySelector(".mobile-toolbar-stub")).toBeNull();
+ expect(container.querySelector(".popup-editor-scroll")?.classList.contains("scroll-edge-fade")).toBe(false);
mocks.isMobile.mockReturnValue(true);
const mobileContainer = document.body.appendChild(document.createElement("div"));
@@ -522,6 +523,7 @@ describe("PopupEditor", () => {
const scroll = mobileContainer.querySelector(".popup-editor-scroll");
const toolbar = mobileContainer.querySelector(".mobile-toolbar-stub");
expect(scroll?.querySelector(".note-detail-stub")).not.toBeNull();
+ expect(scroll?.classList.contains("scroll-edge-fade")).toBe(true);
expect(toolbar).not.toBeNull();
expect(scroll?.contains(toolbar)).toBe(false);
expect(scroll?.nextElementSibling).toBe(toolbar);
diff --git a/apps/client/src/widgets/dialogs/PopupEditor.tsx b/apps/client/src/widgets/dialogs/PopupEditor.tsx
index ad0f53e3b7..806572a9e5 100644
--- a/apps/client/src/widgets/dialogs/PopupEditor.tsx
+++ b/apps/client/src/widgets/dialogs/PopupEditor.tsx
@@ -198,7 +198,7 @@ export default function PopupEditor({ ntxId = POPUP_EDITOR_NTX_ID, openCommand =
noFocus // automatic focus breaks block popup
stackable
>
- <div className="popup-editor-scroll">
+ <div className={`popup-editor-scroll${isMobile ? " scroll-edge-fade" : ""}`}>
<PromotedAttributes />
{!isMobile && <FormattingToolbar />}