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:
committed by
Ian Storm Taylor
parent
fba5bc73e4
commit
670ef391a8
@@ -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') {
|
||||
|
Reference in New Issue
Block a user