Closed erf closed 10 months ago
Hi @erf,
Thank you for reaching out! As you've noticed and as mentioned in our documentation, the set function is designed to override the existing content of the FilterState
with the new Map<FilterGroupID, Set<Filter>>
value you provide. This behavior is intentional to allow for a complete reset or replacement of filters.
If your goal is to modify the content of a specific filter group rather than replacing it entirely, I recommend using the add
and remove
functions. These functions are specifically intended for incremental changes, allowing you to add or remove filters without affecting the existing state of other filters in the group.
Here's a quick example for clarity:
filterState.add(filterGroupId, filter);
filterState.remove(filterGroupId, filter);
These methods ensure that you can manage the filter state dynamically without losing the existing setup. Let me know if this helps or if you have any more questions!
Describe the bug 🐛
Calling
filterState.set
with agroupID
clears filters from other groups as well.