1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-21 22:45:18 +02:00

use updated leaves instead of taking this.leaves (#1904)

This commit is contained in:
Irwan Fario Subastian
2018-06-16 01:41:56 +10:00
committed by Ian Storm Taylor
parent d884be872d
commit afb9dce48a

View File

@@ -312,7 +312,7 @@ class Text extends Record(DEFAULTS) {
if (index >= this.text.length) return if (index >= this.text.length) return
if (index !== 0 || length < this.text.length) { 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) const [middle, after] = Leaf.splitLeaves(bundle, length)
leaves = before.concat(middle.map(x => x.addMarks(marks)), after) leaves = before.concat(middle.map(x => x.addMarks(marks)), after)
return return