Skip to content

Build your personal knowledge base with Trilium Notes

fix(collections/list): excessive spacing in empty note content (closes #7319)

Elian Doran347da8abdecd
diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx
index d29d7e2751..2b5d1bdd0c 100644
--- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx
+++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx
@@ -141,7 +141,11 @@ function NoteContent({ note, trim, noChildrenList, highlightedTokens }: { note:
})
.then(({ $renderedContent, type }) => {
if (!contentRef.current) return;
- contentRef.current.replaceChildren(...$renderedContent);
+ if ($renderedContent[0].innerHTML) {
+ contentRef.current.replaceChildren(...$renderedContent);
+ } else {
+ contentRef.current.replaceChildren();
+ }
contentRef.current.classList.add(`type-${type}`);
highlightSearch(contentRef.current);
})