mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 06:53:25 +02:00
use updated leaves instead of taking this.leaves (#1904)
This commit is contained in:
committed by
Ian Storm Taylor
parent
d884be872d
commit
afb9dce48a
@@ -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
|
||||
|
Reference in New Issue
Block a user