mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-28 23:59:25 +08:00
fix: add scrollIntoView for insertContent
This commit is contained in:
parent
a5794e7c00
commit
e7fe7248af
@ -19,6 +19,7 @@ export const insertContent: RawCommands['insertContent'] = value => ({ tr, dispa
|
||||
|
||||
if (typeof content === 'string') {
|
||||
tr.insertText(content)
|
||||
tr.scrollIntoView()
|
||||
|
||||
return true
|
||||
}
|
||||
@ -29,6 +30,7 @@ export const insertContent: RawCommands['insertContent'] = value => ({ tr, dispa
|
||||
|
||||
tr.insert(tr.selection.anchor, content)
|
||||
selectionToInsertionEnd(tr, tr.steps.length - 1, -1)
|
||||
tr.scrollIntoView()
|
||||
}
|
||||
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user