Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refinement search input resets when a refinement with a different attribute is selected #6277

Open
1 task done
DmitriyMaltsevTakeda opened this issue Jul 10, 2024 · 1 comment
Labels
triage Issues to be categorized by the team

Comments

@DmitriyMaltsevTakeda
Copy link

DmitriyMaltsevTakeda commented Jul 10, 2024

🐛 Current behavior

Screen.Recording.2024-07-10.at.12.51.00.mov

🔍 Steps to reproduce

  1. Go to https://codesandbox.io/p/sandbox/hardcore-dawn-nnz68n?file=%2Fsrc%2FApp.tsx
  2. In the first refinement search input ("Search brands") type anything
  3. Observe that the "Brands" facets are now filtered
  4. Select any other refinement with a different attribute, for example, "Appliances" in "Categories"
  5. Observe that the "Brands" facets are reset, even though the refinement search input still has the previous value

Live reproduction

https://codesandbox.io/p/sandbox/hardcore-dawn-nnz68n?file=%2Fsrc%2FApp.tsx

💭 Expected behavior

The first refinement facets ("Brands" in this particular example) remain filtered

Package version

instantsearch.js@4.73.1, react-instantsearch@7.12.1

Operating system

macOS Sonoma 14.5

Browser

Chrome 125.0.6422.142

Code of Conduct

  • I agree to follow this project's Code of Conduct
@DmitriyMaltsevTakeda DmitriyMaltsevTakeda added the triage Issues to be categorized by the team label Jul 10, 2024
@Haroenv
Copy link
Contributor

Haroenv commented Jul 10, 2024

You could work around this with a custom rendering that calls searchForItems any time there's a query and it renders. It won't do extra requests as it's already done and cached. Would this workaround work for you?

We've considered fixing this in the past but the use case didn't come up often and considered an edge case for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues to be categorized by the team
Projects
None yet
Development

No branches or pull requests

2 participants