algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.69k stars 515 forks source link

Applying a sort removes all widgets in dynamicWidgets #4954

Closed grizzm0 closed 2 years ago

grizzm0 commented 2 years ago

🐛 Bug description

When applying a sort by using the sortBy() widget all widgets in dynamicWidgets() becomes empty. After doing some debugging locally I can see that the items are still being rendered but the parent container is removed from the DOM.

🔍 Bug reproduction

Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/distracted-wu-8p3cr
  2. Click on Price (desc) in sort dropdown
  3. Scroll down to ...
  4. See error

Live reproduction:

https://codesandbox.io/s/distracted-wu-8p3cr

💭 Expected behavior

The facets should not disappear.

🖥 Screenshots

Environment

Additional context

grizzm0 commented 2 years ago

Doesn't look like a bug. Apparently you need to copy all facets to your virtual indices.

tkrugg commented 2 years ago

@grizzm0 Correct! you replica index needs to have facets configured, and most likely with the same exact configuration in this case. Glad you figured it out.