mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 02:19:52 +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:
committed by
Ian Storm Taylor
parent
c58e53364f
commit
f8c74426a5
@@ -557,7 +557,11 @@ Changes.deleteForwardAtRange = (change, range, n = 1, options = {}) => {
|
||||
|
||||
// If the closest is not void, but empty, remove it
|
||||
if (block && !block.isVoid && block.isEmpty && document.nodes.size !== 1) {
|
||||
const nextBlock = document.getNextBlock(block.key)
|
||||
change.removeNodeByKey(block.key, { normalize })
|
||||
if (nextBlock && nextBlock.key) {
|
||||
change.moveToStartOf(nextBlock)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user