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
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
The new
offValuefeature ofconnectToggleRefinementis 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
offValueseems very strange.In
react-instantsearch-domthe toggle refinement was added tocurrentRefinementswhen the user check it. That's it.It had a certain logic as the user added a filter, and oftenly the
currentRefinementis used to display current user filters and allow him to remove them.In the new widget, when you set a offValue :
currentRefinements.currentRefinementstake new refinement.currentRefinementstake the offvalue refinement.currentRefinementswidget, then neither of both onValue and offValue is appliedWhat we expected :
currentRefinementsas it do not result from user interaction (same behavior asConfigurenode)currentRefinementstake new refinement.currentRefinementsremove the onValue refinementcurrentRefinementsshould only untoggle and go back tooffValueCodepen here : https://codesandbox.io/s/focused-leaf-yoj3je?file=/src/App.tsx
What do your think of our UX expectations ?
Yours faithfully,
LCDP
All reactions