Skip to content

Commit

Permalink
FIO-9515 Changed clearOnHide logic when checking conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
antonSoftensity committed Feb 12, 2025
1 parent 96d015e commit 8d481cd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/_classes/component/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2208,11 +2208,11 @@ export default class Component extends Element {

// Check advanced conditions (and cache the result)
const isConditionallyHidden = this.checkConditionallyHidden(data, row) || this._parentConditionallyHidden;
let shouldClear = false;

if (isConditionallyHidden !== this._conditionallyHidden) {
this._conditionallyHidden = isConditionallyHidden;
if (isConditionallyHidden) {
this.clearOnHide();
}
shouldClear = true;
}

// Check visibility
Expand All @@ -2222,6 +2222,12 @@ export default class Component extends Element {
this.visible = visible;
}

// Wait for visibility to update for nested components, so the component state is up-to-date when
// calling clearOnHide
if (shouldClear) {
this.clearOnHide();
}

return visible;
}

Expand Down

0 comments on commit 8d481cd

Please sign in to comment.