React-instantsearch: Unable to use <ClearAll /> with <SortBy /> component

Created on 22 Apr 2018  路  2Comments  路  Source: algolia/react-instantsearch

Hello!

Thank you so much for making such a wonderful search app. It's really great! I'm having an issue that I'm not sure how to address. Any assistance would be appreciated.

What is the current behavior?

I am unable to reset the <SortBy /> components to the default state using the <ClearAll /> component.

Example: https://codesandbox.io/s/vm9o75rpn7

Feedback 鉂わ笍 Bug

Most helpful comment

Thanks a lot for the reproduction of the issue. Indeed we don't support the reset of <SortBy> with the <ClearAll> component. It's because (internally) we don't consider the sort behaviour as a refinement. We plan to support it in a next version.

In the meantime, I built a example with the connectors API that show how you can implement this functionality. Keep in mind that it's very basic implementation (for example the button is not disabled when we don't have refinements). You can find the example on CodeSandbox.

All 2 comments

Thanks a lot for the reproduction of the issue. Indeed we don't support the reset of <SortBy> with the <ClearAll> component. It's because (internally) we don't consider the sort behaviour as a refinement. We plan to support it in a next version.

In the meantime, I built a example with the connectors API that show how you can implement this functionality. Keep in mind that it's very basic implementation (for example the button is not disabled when we don't have refinements). You can find the example on CodeSandbox.

Thank you @samouss!

Was this page helpful?
0 / 5 - 0 ratings