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

Fix deleteCharBackwardAtRange

When we have nested inlines in startBlock, startOffset will point to the wrong character. So, i think that using startText will be correct here.
This commit is contained in:
Evgeniy Kuvshinov
2017-02-02 01:22:38 +05:00
committed by GitHub
parent e1b7a71583
commit e4589a04ab

View File

@@ -131,8 +131,8 @@ export function deleteAtRange(transform, range, options = {}) {
export function deleteCharBackwardAtRange(transform, range, options) {
const { state } = transform
const { startOffset, startBlock } = state
const { text } = startBlock
const { startOffset, startText } = state
const { text } = startText
const n = String.getCharOffsetBackward(text, startOffset)
transform.deleteBackwardAtRange(range, n, options)
}