diff --git a/packages/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts b/packages/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts index 73a994c473b..bd3b9f043ce 100644 --- a/packages/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts +++ b/packages/roosterjs-content-model-plugins/lib/edit/EditPlugin.ts @@ -141,6 +141,16 @@ export class EditPlugin implements EditorPlugin { if (handled) { rawEvent.preventDefault(); + + // Restore the selection to avoid the cursor jump issue + // See: https://issues.chromium.org/issues/330596261 + const selection = editor.getDOMSelection(); + const doc = this.editor?.getDocument(); + doc?.defaultView?.requestAnimationFrame(() => { + if (this.editor) { + this.editor.setDOMSelection(selection); + } + }); } } }