1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-18 13:11:17 +02:00

Account for text being null in an onDrop event (#1647)

This commit is contained in:
Tom Moor
2018-02-21 16:54:28 -08:00
committed by Ian Storm Taylor
parent fba5bc73e4
commit 670ef391a8

View File

@@ -253,11 +253,13 @@ function AfterPlugin() {
if (n) change.collapseToStartOf(n) if (n) change.collapseToStartOf(n)
} }
if (text) {
text.split('\n').forEach((line, i) => { text.split('\n').forEach((line, i) => {
if (i > 0) change.splitBlock() if (i > 0) change.splitBlock()
change.insertText(line) change.insertText(line)
}) })
} }
}
if (type == 'fragment') { if (type == 'fragment') {
change.insertFragment(fragment) change.insertFragment(fragment)