diff --git a/src/transforms/by-key.js b/src/transforms/by-key.js index 56581533b..4b63bbe28 100644 --- a/src/transforms/by-key.js +++ b/src/transforms/by-key.js @@ -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)