From b79c4d810d075549b65fa826e234b20fdc9aa017 Mon Sep 17 00:00:00 2001 From: Jinxuan Zhu Date: Fri, 27 Apr 2018 17:31:04 -0400 Subject: [PATCH] Fix a bug in normalizeNodeByKey (#1786) --- packages/slate/src/changes/with-schema.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/slate/src/changes/with-schema.js b/packages/slate/src/changes/with-schema.js index 4e6368742..91aeca0ef 100644 --- a/packages/slate/src/changes/with-schema.js +++ b/packages/slate/src/changes/with-schema.js @@ -47,7 +47,9 @@ Changes.normalizeNodeByKey = (change, key) => { if (!ancestors) return ancestors.forEach(ancestor => { - normalizeNode(change, ancestor, schema) + if (change.value.document.getDescendant(ancestor.key)) { + normalizeNode(change, ancestor, schema) + } }) }