use replaceWith instead of replaceRangeWith in insertContentAt
This commit is contained in:
@@ -22,8 +22,9 @@ export const insertContentAt: RawCommands['insertContentAt'] = (range, value) =>
|
|||||||
if (dispatch) {
|
if (dispatch) {
|
||||||
const content = createNodeFromContent(value, editor.schema)
|
const content = createNodeFromContent(value, editor.schema)
|
||||||
|
|
||||||
// @ts-ignore
|
tr.replaceWith(range.from, range.to, content)
|
||||||
tr.replaceRangeWith(range.from, range.to, content)
|
|
||||||
|
// set cursor at end of inserted content
|
||||||
selectionToInsertionEnd(tr, tr.steps.length - 1, 1)
|
selectionToInsertionEnd(tr, tr.steps.length - 1, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user