From afb9dce48a966d0426bc1ab0ca219c3f1aedc2df Mon Sep 17 00:00:00 2001 From: Irwan Fario Subastian Date: Sat, 16 Jun 2018 01:41:56 +1000 Subject: [PATCH] use updated leaves instead of taking this.leaves (#1904) --- packages/slate/src/models/text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/slate/src/models/text.js b/packages/slate/src/models/text.js index c42efda2c..6234afd56 100644 --- a/packages/slate/src/models/text.js +++ b/packages/slate/src/models/text.js @@ -312,7 +312,7 @@ class Text extends Record(DEFAULTS) { if (index >= this.text.length) return if (index !== 0 || length < this.text.length) { - const [before, bundle] = Leaf.splitLeaves(this.leaves, index) + const [before, bundle] = Leaf.splitLeaves(leaves, index) const [middle, after] = Leaf.splitLeaves(bundle, length) leaves = before.concat(middle.map(x => x.addMarks(marks)), after) return