mirror of
https://github.com/cudr/slate-collaborative.git
synced 2024-10-27 20:34:06 +00:00
ignore non-children path of remove op
This commit is contained in:
parent
dfbb59616a
commit
56b1902577
@ -90,7 +90,9 @@ const opRemove = (
|
||||
|
||||
if (type === 'map' && path) {
|
||||
// remove a key from map, mapping to slate set a key's value to undefined.
|
||||
ops.push(setDataOp(op, doc)(map, tmpDoc))
|
||||
if (path[0] === 'children') {
|
||||
ops.push(setDataOp(op, doc)(map, tmpDoc))
|
||||
}
|
||||
return [map, ops]
|
||||
}
|
||||
|
||||
@ -109,8 +111,6 @@ const opRemove = (
|
||||
|
||||
const key = path[path.length - 1]
|
||||
|
||||
if (key === 'cursors' || op.key === 'cursors') return [map, ops]
|
||||
|
||||
const fn = key === 'text' ? removeTextOp : removeNodeOp
|
||||
|
||||
return [map, [...ops, fn(op)(map, tmpDoc)]]
|
||||
|
Loading…
Reference in New Issue
Block a user