Skip to content

Build your personal knowledge base with Trilium Notes

fix(ckeditor5): moving block sometimes doesn't work

Elian Doran598bbb150a63
diff --git a/packages/ckeditor5/src/plugins/move_block_updown.ts b/packages/ckeditor5/src/plugins/move_block_updown.ts
index f2f9c7193e..235dbcbbde 100644
--- a/packages/ckeditor5/src/plugins/move_block_updown.ts
+++ b/packages/ckeditor5/src/plugins/move_block_updown.ts
@@ -158,8 +158,6 @@ class MoveBlockDownCommand extends MoveBlockUpDownCommand {
}
function scrollToSelection(editor: Editor) {
- // Ensure scroll happens in sync with DOM updates
- requestAnimationFrame(() => {
- editor.editing.view.scrollToTheSelection();
- });
+ editor.editing.view.forceRender();
+ editor.editing.view.scrollToTheSelection();
};