-
Notifications
You must be signed in to change notification settings - Fork 386
Fix: Compute canRefine on the transformed items #1568
Conversation
Deploy preview for react-instantsearch ready! Built with commit 111eb18 https://deploy-preview-1568--react-instantsearch.netlify.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes and sorry for the late review. We can add a test on each of the connectors to verify that the canRefine
is actually computed on the correct transformed value. Let me know if you have the time to implement it.
@samouss yep, I can add those tests in the next couple of days. |
@samouss, better late than never :-). Just pushed up those new tests. |
One last change and we are ready to merge! You have to run Prettier to fix the style issue. Thanks a lot for your contributions! |
Resolves #1524
Summary
There was previously a bug where
canRefine
props were calculated based on untransformed item lists. This caused unintended behaviors such as a ClearRefinements button remaining active when a refinement being ignored via a filter intransformItems
was present.Result
This PR calculates
canRefine
on the transformed list of items, correcting this behavior.