Changing operator of a refinement list erases any existing refinements #6507
-
I am using React InstantSearch. I have a I find that if a user selects certain values for refinement, and then proceeds to toggle the operator, the selected values are erased. Bug or Feature? Seems to be a wrong decision to erase any existing refinements if the operator changes... The only thing that needs to change is how the values are treated. Is there anyway (besides having to remember the state myself) to prevent this? EDIT: I would like to add another behaviour that just seems to be a poor decision (again - not sure if bug or feature). When the refinement is cleared in the above scenario, the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
It's a feature and a limitation of the way the change in parameters is handled. When a parameter of a widget changes, it's assumed that the previous widget stops displaying and a new widget with the new parameters gets added. If for example you'd change the attribute, the refinement obviously should be cleared. For You'll have to keep track of the state before changing the operator (eg via ui state from useInstantSearch) and re-apply it after changing the operator. |
Beta Was this translation helpful? Give feedback.
It's a feature and a limitation of the way the change in parameters is handled. When a parameter of a widget changes, it's assumed that the previous widget stops displaying and a new widget with the new parameters gets added. If for example you'd change the attribute, the refinement obviously should be cleared. For
operator
that could be an exception that the state could be kept, but there's no functionality of that.You'll have to keep track of the state before changing the operator (eg via ui state from useInstantSearch) and re-apply it after changing the operator.