use replaceWith instead of replaceRangeWith in insertContentAt

This commit is contained in:
Philipp Kühn 2021-05-05 18:48:22 +02:00
parent 9320eaf05f
commit 71740687f4

View File

@ -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)
}