diff --git a/packages/amis-editor-core/src/store/node.ts b/packages/amis-editor-core/src/store/node.ts index 5b4a2fe9d..ed00ad596 100644 --- a/packages/amis-editor-core/src/store/node.ts +++ b/packages/amis-editor-core/src/store/node.ts @@ -525,7 +525,7 @@ export const EditorNode = types function getClosestParentByType(type: string): EditorNodeType | void { let node = self; - while ((node = node.parent)) { + while (node === node.parent) { if (node.schema.type === type) { return node as EditorNodeType; }