editor: fix editor not scrolling to selected search result

This commit is contained in:
Abdullah Atta
2026-05-22 20:21:53 +05:00
parent 36d009a9fb
commit 75f0804dbf

View File

@@ -478,8 +478,9 @@ export const SearchReplace = Extension.create<SearchOptions, SearchStorage>({
if (!isSearchTransaction || !selectedResult) return; if (!isSearchTransaction || !selectedResult) return;
const tr = newState.tr; const tr = newState.tr;
scrollIntoView(this.editor.view, selectedResult.from);
if (expandCollapsedParents(tr, selectedResult.from)) { if (expandCollapsedParents(tr, selectedResult.from)) {
scrollIntoView(this.editor.view, selectedResult.from);
return tr; return tr;
} }
} }