1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +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,10 +253,12 @@ function AfterPlugin() {
if (n) change.collapseToStartOf(n)
}
text.split('\n').forEach((line, i) => {
if (i > 0) change.splitBlock()
change.insertText(line)
})
if (text) {
text.split('\n').forEach((line, i) => {
if (i > 0) change.splitBlock()
change.insertText(line)
})
}
}
if (type == 'fragment') {