Skip to content

removeFilter does not support removing a filter value which consists of a list of Filtervalues #1204

@MelleWb

Description

@MelleWb

Describe the bug
removeFilter does not correctly remove multiple filter values when the filter was created using setFilter with an array of values. While setFilter supports setting multiple values at once, removeFilter only works for single values.

To Reproduce
Set a filter with multiple values:

  • setFilter("states", ["Alaska", "California"], "all", true);
    Attempt to remove the filter using the same values:
  • removeFilter("states", ["Alaska", "California"]);
    Observe that the filter remains unchanged.

This example comes directly from the documentation, but this is how I use it as well.

Expected behavior
Calling removeFilter with an array of values should remove all matching filter values, mirroring the behavior of setFilter.

Screenshots
Not applicable

Which backends and packages are you using:
Backend: App Search
Packages: react-search-ui

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions