Skip to content

Commit

Permalink
feat(filter-panel): fix corner case reveal error (carbon-design-syste…
Browse files Browse the repository at this point in the history
…m#7405)

Fixes an issue where: given I open a filter group with excess filters, and
I reveal all filters, and I select a previously hidden filter, and I close
the filter group, and I reopen the filter group, and I unselect the previously
selected filter, then the filter group re-hides the excess filters.
  • Loading branch information
jkaeser committed Feb 3, 2022
1 parent 84a738b commit 3fef125
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ class DDSFilterGroupItem extends StableSelectorMixin(BXAccordionItem) {

/**
* Retrieves view all state stored in the filter panel composite. Returns
* false if none is found.
* internal value if no cache is found.
*/
protected _getCachedViewAllValue(): boolean {
const { titleText } = this;
let result: boolean = false;
const { allRevealed, titleText } = this;
let result: boolean = allRevealed;

const filterPanel = this.closest('dds-filter-panel');
if (filterPanel) {
Expand Down Expand Up @@ -204,8 +204,7 @@ class DDSFilterGroupItem extends StableSelectorMixin(BXAccordionItem) {

// Reset `allRevealed` on accordion close.
if (prevOpen) {
this.allRevealed = false;
this._dispatchViewAllEvent(false);
this.allRevealed = this._hasHiddenActiveFilter() || false;
}

// Respect `allRevealed` attribute.
Expand Down

0 comments on commit 3fef125

Please sign in to comment.