X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/9bfcadd95f4c3917ff4aa4fd4b10bfa7ce4c6c09..refs/pull/5592/head:/resources/js/wysiwyg/services/keyboard-handling.ts diff --git a/resources/js/wysiwyg/services/keyboard-handling.ts b/resources/js/wysiwyg/services/keyboard-handling.ts index 0ef0b81bf..a7f1ec7f0 100644 --- a/resources/js/wysiwyg/services/keyboard-handling.ts +++ b/resources/js/wysiwyg/services/keyboard-handling.ts @@ -79,22 +79,19 @@ function focusAdjacentOrInsertForSingleSelectNode(editor: LexicalEditor, event: const nearestBlock = $getNearestNodeBlockParent(node) || node; let target = after ? nearestBlock.getNextSibling() : nearestBlock.getPreviousSibling(); - requestAnimationFrame(() => { - editor.update(() => { - if (!target) { - target = $createParagraphNode(); - if (after) { - nearestBlock.insertAfter(target) - } else { - nearestBlock.insertBefore(target); - } + editor.update(() => { + if (!target) { + target = $createParagraphNode(); + if (after) { + nearestBlock.insertAfter(target) + } else { + nearestBlock.insertBefore(target); } + } - target.selectStart(); - }); + target.selectStart(); }); - return true; }