mirror of
https://github.com/zadam/trilium.git
synced 2025-12-20 14:24:27 +01:00
fix(highlights_list): unable to scroll to text fragments
This commit is contained in:
parent
751a874c51
commit
28d9d98964
@ -117,7 +117,12 @@ function EditableTextHighlightsList() {
|
|||||||
const domPos = domConverter.viewPositionToDom(viewPos);
|
const domPos = domConverter.viewPositionToDom(viewPos);
|
||||||
|
|
||||||
if (!domPos) return;
|
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 ]);
|
}, [ textEditor ]);
|
||||||
|
|
||||||
return <AbstractHighlightsList
|
return <AbstractHighlightsList
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user