Browse Source

fix collection display (#6498)

release-v0.22.7-rc.0
mohamed yahia 10 months ago
committed by GitHub
parent
commit
4a279e2f16
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts

6
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;
}

Loading…
Cancel
Save