mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-19 13:41:19 +02:00
Remove weird if/then/else
This commit is contained in:
@@ -262,8 +262,9 @@ function removeNode(state, operation) {
|
||||
.takeUntil(text => text.key == startKey)
|
||||
.filter(text => !getRemoved(text.key))
|
||||
.last()
|
||||
if (!prevText) selection = selection.unset()
|
||||
else selection = selection.moveStartTo(prevText.key, prevText.length)
|
||||
selection = !prevText
|
||||
? selection.unset()
|
||||
: selection.moveStartTo(prevText.key, prevText.length)
|
||||
}
|
||||
if (endDesc) {
|
||||
// The whole selection is inside the node, we collapse to the previous text node
|
||||
@@ -276,8 +277,9 @@ function removeNode(state, operation) {
|
||||
.filter(text => !getRemoved(text.key))
|
||||
.first()
|
||||
|
||||
if (!nextText) selection = selection.unset()
|
||||
else selection = selection.moveEndTo(nextText.key, 0)
|
||||
selection = !nextText
|
||||
? selection.unset()
|
||||
: selection.moveEndTo(nextText.key, 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user