Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix editor not jumping to search result

Abdullah Attac53fbb74413a
diff --git a/apps/web/src/components/editor/index.tsx b/apps/web/src/components/editor/index.tsx
index 6180c7e39..4e23d6a28 100644
--- a/apps/web/src/components/editor/index.tsx
+++ b/apps/web/src/components/editor/index.tsx
@@ -866,8 +866,12 @@ function useScrollToSearchResult(session: EditorSession) {
);
scrollContainer?.closest(".active")?.classList.add("searching");
const elements = scrollContainer?.getElementsByTagName("nn-search-result");
- setTimeout(() =>
- elements?.item(index)?.scrollIntoView({ block: "center" })
+ setTimeout(
+ () =>
+ elements
+ ?.item(index)
+ ?.scrollIntoView({ block: "center", behavior: "instant" }),
+ 100
);
useEditorStore.getState().updateSession(session.id, [session.type], {
activeSearchResultIndex: undefined