1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-28 17:39:57 +02:00

Fix normalize calls after moveNodeByKey

This commit is contained in:
Samy Pesse
2016-10-24 23:30:54 +02:00
parent 684d51e4b6
commit d6e57d297e

View File

@@ -134,7 +134,7 @@ export function moveNodeByKey(transform, key, newKey, newIndex, options = {}) {
const { document } = state
const path = document.getPath(key)
const newPath = document.getPath(newKey)
const parent = document.key == newKey ? null : document.getCommonAncestor(key, newKey)
const parent = document.key == newKey ? document : document.getCommonAncestor(key, newKey)
transform = transform.moveNodeOperation(path, newPath, newIndex)