Strange behavior for offValue from ToggleRefinement / connectToggleRefinement #5506
Unanswered
AntoineDuComptoirDesPharmacies
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
The new
offValue
feature ofconnectToggleRefinement
is very promising because in the past we had to do a custom connector to apply search filters when toggle is unchecked.However, the UX behavior of
offValue
seems very strange.In
react-instantsearch-dom
the toggle refinement was added tocurrentRefinements
when the user check it. That's it.It had a certain logic as the user added a filter, and oftenly the
currentRefinement
is used to display current user filters and allow him to remove them.In the new widget, when you set a offValue :
currentRefinements
.currentRefinements
take new refinement.currentRefinements
take the offvalue refinement.currentRefinements
widget, then neither of both onValue and offValue is appliedWhat we expected :
currentRefinements
as it do not result from user interaction (same behavior asConfigure
node)currentRefinements
take new refinement.currentRefinements
remove the onValue refinementcurrentRefinements
should only untoggle and go back tooffValue
Codepen here : https://codesandbox.io/s/focused-leaf-yoj3je?file=/src/App.tsx
What do your think of our UX expectations ?
Yours faithfully,
LCDP
Beta Was this translation helpful? Give feedback.
All reactions