From 6222a8d103de6a5c8681fed5489c6efcca7f23e6 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 30 Jan 2025 14:20:21 +0530 Subject: [PATCH] feat: remove cursor manipulation not needed anymore --- .../widgets/WootWriter/FullEditor.vue | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/WootWriter/FullEditor.vue b/app/javascript/dashboard/components/widgets/WootWriter/FullEditor.vue index 75e54db8b..e097cea60 100644 --- a/app/javascript/dashboard/components/widgets/WootWriter/FullEditor.vue +++ b/app/javascript/dashboard/components/widgets/WootWriter/FullEditor.vue @@ -170,9 +170,6 @@ export default { } }, reloadState() { - const oldSelection = editorView.state.selection; - const oldDoc = editorView.state.doc; - state = createState( this.modelValue, this.placeholder, @@ -181,20 +178,6 @@ export default { this.enabledMenuOptions ); - const tr = state.tr; - // Only try to map and restore selection if there was a previous document - if (oldDoc) { - try { - // Map the old selection to the new document structure - const newSelection = Selection.near( - tr.doc.resolve(Math.min(oldSelection.from, tr.doc.content.size)) - ); - tr.setSelection(newSelection); - } catch (error) { - console.warn('Could not restore cursor position:', error); - } - } - state = state.apply(tr); editorView.updateState(state); editorView.focus(); },