Skip to content

Conversation

@mskutle
Copy link

@mskutle mskutle commented Nov 14, 2025

Thanks for this great package! Everything worked nicely for me, except for one thing. Numeric filters would always yield 0 results. However, the filter would work if there was a search query specified. So, if I narrowed the results by passing a search query and THEN applied the filter (using RangeInput from react-instantsearch in my case) it would correctly filter those results.

I cloned your demo app (https://github.com/unplatform-io/clientside-instantsearch-demo) to see if it worked correctly there, but that app had the same behaviour.

Steps to reproduce

  1. Clone https://github.com/unplatform-io/clientside-instantsearch-demo and start it up
  2. Try to apply the "price" range filter.
  3. You should not get any results
  4. Put something in the search input that narrows the result
  5. Apply the price filter again
  6. It works

Solution

There seems to be an issue with ItemsJS when you supply a filter function together with an empty query. So my workaround is to check for an empty query, and in that case apply the filter afterwards instead.

Everything works for me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant