Skip to content

Commit

Permalink
wc: Fix filter clear event in variant browser #TASK-7216 #TASK-7100
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes committed Jan 24, 2025
1 parent 7f97ef4 commit 0324abc
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/webcomponents/variant/variant-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,16 @@ export default class VariantBrowser extends LitElement {
this.requestUpdate();
}

onQueryFilterChange(e) {
onVariantFilterClear() {
this.preparedQuery = {};
this.executedQuery = {};
this.searchActive = false;
this.variant = null;
this.notifySearch(this.preparedQuery);
this.requestUpdate();
}

onVariantFilterChange(e) {
this.preparedQuery = e.detail.query;
this.requestUpdate();
}
Expand Down Expand Up @@ -384,8 +393,9 @@ export default class VariantBrowser extends LitElement {
.query="${this.preparedQuery}"
.searchActive="${this.searchActive || false}"
.config="${this._config.filter}"
@queryChange="${this.onQueryFilterChange}"
@querySearch="${this.onVariantFilterSearch}">
@queryChange="${this.onVariantFilterChange}"
@querySearch="${this.onVariantFilterSearch}"
@queryClear="${this.onVariantFilterClear}">
</variant-browser-filter>
<div class="main-view">
Expand Down

0 comments on commit 0324abc

Please sign in to comment.