1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-21 22:45:18 +02:00

Use moveEnd/Start in removeText

This commit is contained in:
Samy Pessé
2016-10-26 14:01:31 +02:00
parent 0e1602c964
commit 9f5807e008

View File

@@ -231,10 +231,10 @@ function removeText(state, operation) {
// Update the selection
if (startKey == node.key && startOffset >= rangeOffset) {
selection = selection.extendStartOffset(-length)
selection = selection.moveStartOffset(-length)
}
if (endKey == node.key && endOffset >= rangeOffset) {
selection = selection.extendEndOffset(-length)
selection = selection.moveEndOffset(-length)
}
state = state.merge({ document, selection })