From 214f42551e3d0477dc2a5e22726371722f0e962a Mon Sep 17 00:00:00 2001 From: mohamedsalem401 Date: Wed, 29 Jan 2025 13:31:24 +0200 Subject: [PATCH] Update the logic for getComponentDef --- .../model/data_collection/ComponentDataCollection.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts b/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts index 6e9b32f31..2b015f87c 100644 --- a/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts +++ b/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts @@ -78,12 +78,7 @@ export default class ComponentDataCollection extends Component { } private getComponentDef() { - const firstChild = this.components().at(0); - const firstChildJSON = firstChild?.toJSON() ?? {}; - const shouldHaveChildren = firstChild && !firstChild.get(keyCollectionDefinition) && firstChild.components().length; - if (shouldHaveChildren) { - firstChildJSON.components = firstChild.components().map((component) => component.toJSON()); - } + const firstChildJSON = JSON.parse(JSON.stringify(this.components().at(0))); delete firstChildJSON.draggable; return firstChildJSON;