How to show list current filter in Resource list

657 views reactjs
6

I'm using resource list control of polaris. I have add some filter conditions and my list displayed with correct data. But i don't see current list filter area where i can remove my conditions. How to display it? This is my filter declaretion, I wonder is it some problem with my appliedFilters variable.

 filterControl={
                    <ResourceList.FilterControl
                      resourceName={resourceName}
                      filters={availableFilters}
                      appliedFilters={appliedFilters}
                      onFiltersChange={this.handleFiltersChange}
                      searchValue={searchValue}
                      onSearchChange={this.handleSearchChange}             
                    />
                  }

answered question

1 Answer

5

you need set again data for appliedFilters on onFiltersChange event to display current filter list. i suggest you store this variable in local state of component as code bellow:

this.setState({ appliedFilters:appliedFilters});

posted this

Have an answer?

JD

Please login first before posting an answer.