Commit acbd15c 1 parent 214f425 commit acbd15c Copy full SHA for acbd15c
File tree 1 file changed +5
-4
lines changed
packages/core/src/data_sources/model/data_collection
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -69,17 +69,18 @@ export default class ComponentDataCollection extends Component {
69
69
toJSON ( opts ?: ObjectAny ) {
70
70
const json = super . toJSON . call ( this , opts ) as ComponentDataCollectionDefinition ;
71
71
72
- const firstChild = this . getComponentDef ( ) ;
73
- json [ keyCollectionDefinition ] . componentDef = firstChild ;
72
+ const firstChildJSON = this . getComponentDef ( ) ;
73
+ json [ keyCollectionDefinition ] . componentDef = firstChildJSON ?? this . get ( keyCollectionDefinition ) ;
74
74
75
75
delete json . components ;
76
76
delete json . droppable ;
77
77
return json ;
78
78
}
79
79
80
80
private getComponentDef ( ) {
81
- const firstChildJSON = JSON . parse ( JSON . stringify ( this . components ( ) . at ( 0 ) ) ) ;
82
- delete firstChildJSON . draggable ;
81
+ const firstChild = this . components ( ) . at ( 0 ) ;
82
+ const firstChildJSON = firstChild ?. toJSON ( ) ;
83
+ delete firstChildJSON ?. draggable ;
83
84
84
85
return firstChildJSON ;
85
86
}
You can’t perform that action at this time.
0 commit comments