Skip to content

Commit

Permalink
Trigger editor.insertText by paste too (#3776)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerkly authored Jul 10, 2020
1 parent 68acd6b commit 97dbab1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/slate-react/src/plugin/with-react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const withReact = <T extends Editor>(editor: T) => {
if (fragment) {
const decoded = decodeURIComponent(window.atob(fragment))
const parsed = JSON.parse(decoded) as Node[]
Transforms.insertFragment(e, parsed)
e.insertFragment(parsed)
return
}

Expand All @@ -163,7 +163,7 @@ export const withReact = <T extends Editor>(editor: T) => {
Transforms.splitNodes(e, { always: true })
}

Transforms.insertText(e, line)
e.insertText(line)
split = true
}
}
Expand Down

0 comments on commit 97dbab1

Please sign in to comment.