mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 15:02:51 +02:00
Use moveEnd/Start in removeText
This commit is contained in:
@@ -231,10 +231,10 @@ function removeText(state, operation) {
|
|||||||
|
|
||||||
// Update the selection
|
// Update the selection
|
||||||
if (startKey == node.key && startOffset >= rangeOffset) {
|
if (startKey == node.key && startOffset >= rangeOffset) {
|
||||||
selection = selection.extendStartOffset(-length)
|
selection = selection.moveStartOffset(-length)
|
||||||
}
|
}
|
||||||
if (endKey == node.key && endOffset >= rangeOffset) {
|
if (endKey == node.key && endOffset >= rangeOffset) {
|
||||||
selection = selection.extendEndOffset(-length)
|
selection = selection.moveEndOffset(-length)
|
||||||
}
|
}
|
||||||
|
|
||||||
state = state.merge({ document, selection })
|
state = state.merge({ document, selection })
|
||||||
|
Reference in New Issue
Block a user