Skip to content

Commit

Permalink
fix: add scrollIntoView for insertContent
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed Apr 9, 2021
1 parent a5794e7 commit e7fe724
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/commands/insertContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const insertContent: RawCommands['insertContent'] = value => ({ tr, dispa

if (typeof content === 'string') {
tr.insertText(content)
tr.scrollIntoView()

return true
}
Expand All @@ -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
Expand Down

0 comments on commit e7fe724

Please sign in to comment.