fix: add scrollIntoView for insertContent
This commit is contained in:
@@ -19,6 +19,7 @@ export const insertContent: RawCommands['insertContent'] = value => ({ tr, dispa
|
|||||||
|
|
||||||
if (typeof content === 'string') {
|
if (typeof content === 'string') {
|
||||||
tr.insertText(content)
|
tr.insertText(content)
|
||||||
|
tr.scrollIntoView()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -29,6 +30,7 @@ export const insertContent: RawCommands['insertContent'] = value => ({ tr, dispa
|
|||||||
|
|
||||||
tr.insert(tr.selection.anchor, content)
|
tr.insert(tr.selection.anchor, content)
|
||||||
selectionToInsertionEnd(tr, tr.steps.length - 1, -1)
|
selectionToInsertionEnd(tr, tr.steps.length - 1, -1)
|
||||||
|
tr.scrollIntoView()
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user