diff --git a/packages/slate/src/models/value.js b/packages/slate/src/models/value.js index 02884c3c5..bd2427ef2 100644 --- a/packages/slate/src/models/value.js +++ b/packages/slate/src/models/value.js @@ -622,18 +622,18 @@ class Value extends Record(DEFAULTS) { value = value.set('document', document) value = value.mapRanges(range => { - const { start, end } = range + const { anchor, focus } = range - if (node.hasNode(start.key)) { + if (node.hasNode(anchor.key)) { range = prev - ? range.moveStartTo(prev.key, prev.text.length) - : next ? range.moveStartTo(next.key, 0) : range.unset() + ? range.moveAnchorTo(prev.key, prev.text.length) + : next ? range.moveAnchorTo(next.key, 0) : range.unset() } - if (node.hasNode(end.key)) { + if (node.hasNode(focus.key)) { range = prev - ? range.moveEndTo(prev.key, prev.text.length) - : next ? range.moveEndTo(next.key, 0) : range.unset() + ? range.moveFocusTo(prev.key, prev.text.length) + : next ? range.moveFocusTo(next.key, 0) : range.unset() } range = range.updatePoints(point => point.setPath(null))