Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(highlights_list): unable to scroll to text fragments
Elian Doran28d9d98964f9
diff --git a/apps/client/src/widgets/sidebar/HighlightsList.tsx b/apps/client/src/widgets/sidebar/HighlightsList.tsxindex 4007cc91f8..be1e170e16 100644--- a/apps/client/src/widgets/sidebar/HighlightsList.tsx+++ b/apps/client/src/widgets/sidebar/HighlightsList.tsx@@ -117,7 +117,12 @@ function EditableTextHighlightsList() {const domPos = domConverter.viewPositionToDom(viewPos);if (!domPos) return;- (domPos.parent as HTMLElement).scrollIntoView();+ if (domPos.parent instanceof HTMLElement) {+ domPos.parent.scrollIntoView();+ } else if (domPos.parent instanceof Text) {+ domPos.parent.parentElement?.scrollIntoView();+ }+}, [ textEditor ]);return <AbstractHighlightsList