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:
committed by
Ian Storm Taylor
parent
fba5bc73e4
commit
670ef391a8
@@ -253,10 +253,12 @@ function AfterPlugin() {
|
|||||||
if (n) change.collapseToStartOf(n)
|
if (n) change.collapseToStartOf(n)
|
||||||
}
|
}
|
||||||
|
|
||||||
text.split('\n').forEach((line, i) => {
|
if (text) {
|
||||||
if (i > 0) change.splitBlock()
|
text.split('\n').forEach((line, i) => {
|
||||||
change.insertText(line)
|
if (i > 0) change.splitBlock()
|
||||||
})
|
change.insertText(line)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == 'fragment') {
|
if (type == 'fragment') {
|
||||||
|
Reference in New Issue
Block a user