From ec5667194f9c40e74e38e54a1a8c2ffe5c4e7ab5 Mon Sep 17 00:00:00 2001 From: "M. Palanikannan" <73993394+Palanikannan1437@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:35:10 +0530 Subject: [PATCH] fix: unnecessary focus in editor on swr sync (#4215) --- packages/editor/core/src/hooks/use-editor.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/editor/core/src/hooks/use-editor.tsx b/packages/editor/core/src/hooks/use-editor.tsx index f5500e725..ae7d90342 100644 --- a/packages/editor/core/src/hooks/use-editor.tsx +++ b/packages/editor/core/src/hooks/use-editor.tsx @@ -112,12 +112,9 @@ export const useEditor = ({ editor.commands.setContent(value); const currentSavedSelection = savedSelectionRef.current; if (currentSavedSelection) { - editor.view.focus(); const docLength = editor.state.doc.content.size; const relativePosition = Math.min(currentSavedSelection.from, docLength - 1); editor.commands.setTextSelection(relativePosition); - } else { - editor.commands.focus("end"); } } catch (error) { console.error("Error syncing editor content with external value:", error);