From 4a279e2f168aa0c7a33a5fcda0436939cdacd9af Mon Sep 17 00:00:00 2001 From: mohamed yahia Date: Wed, 23 Apr 2025 14:45:47 +0200 Subject: [PATCH] fix collection display (#6498) --- .../model/data_collection/ComponentDataCollection.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 ab0a535e6..10ddd5044 100644 --- a/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts +++ b/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts @@ -169,7 +169,9 @@ export default class ComponentDataCollection extends Component { private getCollectionItems() { const firstChild = this.ensureFirstChild(); - const initialDisplayValue = firstChild.getStyle()['display'] ?? ''; + const displayStyle = firstChild.getStyle()['display']; + const isDisplayNoneOrMissing = !displayStyle || displayStyle === 'none'; + const resolvedDisplay = isDisplayNoneOrMissing ? '' : displayStyle; // TODO: Move to component view firstChild.addStyle({ display: 'none' }, AvoidStoreOptions); const components: Component[] = [firstChild]; @@ -201,7 +203,7 @@ export default class ComponentDataCollection extends Component { setCollectionStateMapAndPropagate(firstChild, collectionsStateMap); // TODO: Move to component view - firstChild.addStyle({ display: initialDisplayValue }, AvoidStoreOptions); + firstChild.addStyle({ display: resolvedDisplay }, AvoidStoreOptions); continue; }