Skip to content

Build your personal knowledge base with Trilium Notes

fix(collections/list): not reacting to expand/collapse button (closes #7209)

Elian Doran69a59f09359f
diff --git a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx
index b88812d729..274ef21110 100644
--- a/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx
+++ b/apps/client/src/widgets/collections/legacy/ListOrGridView.tsx
@@ -59,8 +59,8 @@ function ListNoteCard({ note, parentNote, expand, highlightedTokens }: { note: F
const [ isExpanded, setExpanded ] = useState(expand);
const notePath = getNotePath(parentNote, note);
- // Reset expand state if switching to another note.
- useEffect(() => setExpanded(expand), [ note ]);
+ // Reset expand state if switching to another note, or if user manually toggled expansion state.
+ useEffect(() => setExpanded(expand), [ note, expand ]);
return (
<div