diff --git a/packages/slate/src/models/value.js b/packages/slate/src/models/value.js
index f74414fc0..02884c3c5 100644
--- a/packages/slate/src/models/value.js
+++ b/packages/slate/src/models/value.js
@@ -799,16 +799,16 @@ class Value extends Record(DEFAULTS) {
value = value.mapRanges(range => {
const next = newDocument.getNextText(node.key)
- const { start, end } = range
+ const { anchor, focus } = range
- // If the start was after the split, move it to the next node.
- if (node.key === start.key && position <= start.offset) {
- range = range.moveStartTo(next.key, start.offset - position)
+ // If the anchor was after the split, move it to the next node.
+ if (node.key === anchor.key && position <= anchor.offset) {
+ range = range.moveAnchorTo(next.key, anchor.offset - position)
}
- // If the end was after the split, move it to the next node.
- if (node.key === end.key && position <= end.offset) {
- range = range.moveEndTo(next.key, end.offset - position)
+ // If the focus was after the split, move it to the next node.
+ if (node.key === focus.key && position <= focus.offset) {
+ range = range.moveFocusTo(next.key, focus.offset - position)
}
range = range.updatePoints(point => point.setPath(null))
diff --git a/packages/slate/test/commands/at-current-range/remove-mark/part-of-mark-backward.js b/packages/slate/test/commands/at-current-range/remove-mark/part-of-mark-backward.js
new file mode 100644
index 000000000..c23513da8
--- /dev/null
+++ b/packages/slate/test/commands/at-current-range/remove-mark/part-of-mark-backward.js
@@ -0,0 +1,30 @@
+/** @jsx h */
+
+import h from '../../../helpers/h'
+
+export default function(editor) {
+ editor.removeMark('bold')
+}
+
+export const input = (
+
+
+
+
+ word
+
+
+
+
+)
+
+export const output = (
+
+
+
+ wor
+ d
+
+
+
+)
diff --git a/packages/slate/test/commands/at-current-range/remove-mark/part-of-mark.js b/packages/slate/test/commands/at-current-range/remove-mark/part-of-mark.js
new file mode 100644
index 000000000..f83f87662
--- /dev/null
+++ b/packages/slate/test/commands/at-current-range/remove-mark/part-of-mark.js
@@ -0,0 +1,30 @@
+/** @jsx h */
+
+import h from '../../../helpers/h'
+
+export default function(editor) {
+ editor.removeMark('bold')
+}
+
+export const input = (
+
+
+
+
+ word
+
+
+
+
+)
+
+export const output = (
+
+
+
+ wor
+ d
+
+
+
+)