From 71740687f47ff17359b6bd35139a81b4fc548db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Wed, 5 May 2021 18:48:22 +0200 Subject: [PATCH] use replaceWith instead of replaceRangeWith in insertContentAt --- packages/core/src/commands/insertContentAt.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/src/commands/insertContentAt.ts b/packages/core/src/commands/insertContentAt.ts index ef8002fb..dde7eb6d 100644 --- a/packages/core/src/commands/insertContentAt.ts +++ b/packages/core/src/commands/insertContentAt.ts @@ -22,8 +22,9 @@ export const insertContentAt: RawCommands['insertContentAt'] = (range, value) => if (dispatch) { const content = createNodeFromContent(value, editor.schema) - // @ts-ignore - tr.replaceRangeWith(range.from, range.to, content) + tr.replaceWith(range.from, range.to, content) + + // set cursor at end of inserted content selectionToInsertionEnd(tr, tr.steps.length - 1, 1) }