1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-20 13:22:04 +02:00

Fix move_node caused full re-render. (#4120)

This commit is contained in:
Ulion 2021-04-01 06:25:09 +08:00 committed by GitHub
parent bbd7d9c330
commit b64fbd06d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,7 +78,12 @@ export const withReact = <T extends Editor>(editor: T) => {
}
case 'move_node': {
// TODO
for (const [node, path] of Editor.levels(e, {
at: Path.common(Path.parent(op.path), Path.parent(op.newPath)),
})) {
const key = ReactEditor.findKey(e, node)
matches.push([path, key])
}
break
}
}