1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 18:39:51 +02:00

fix(at-range): forward deletion now stays with next block. (#1459)

* fix(at-range): forward deletion now stays with next block.

* fix(at-range): use select instead of moveToRangeOf

* Revert "fix(at-range): use select instead of moveToRangeOf"

This reverts commit 43bf33e29d.

* fix(at-range): moveOffsetsTo

* fix(at-range): change to change.moveToStartOf(nextBlock)
This commit is contained in:
David Silva
2017-12-11 16:14:25 +01:00
committed by Ian Storm Taylor
parent c58e53364f
commit f8c74426a5

View File

@@ -557,7 +557,11 @@ Changes.deleteForwardAtRange = (change, range, n = 1, options = {}) => {
// If the closest is not void, but empty, remove it // If the closest is not void, but empty, remove it
if (block && !block.isVoid && block.isEmpty && document.nodes.size !== 1) { if (block && !block.isVoid && block.isEmpty && document.nodes.size !== 1) {
const nextBlock = document.getNextBlock(block.key)
change.removeNodeByKey(block.key, { normalize }) change.removeNodeByKey(block.key, { normalize })
if (nextBlock && nextBlock.key) {
change.moveToStartOf(nextBlock)
}
return return
} }