[Instantsearch JS v2] Filter by single refinement + Filter by 2 refinements by default

Hi all,

I’m currently implementing a simple status filter but got stuck with a custom requirement:

On initial page load, we want to filter by two statuses. Then the filter works just like a simple status filter.

How do you set initial refinements anyway? When using a menuSelect: How to filter by two values at once? When using a refinementList: How to reset the previous refinement when a new status is selected?

What would be your solution to implement this?


A menu refinement only allows a single value to be selected at once, so this wouldn’t fit your use case. What is the expected behaviour when someone selects something, and then goes back to zero refinements. Should this go back to the “default” refinements? A feature we have is initialUiState, however this will stay when someone refines, to prevent confusion: https://codesandbox.io/s/wandering-water-zjfnp?file=/src/app.js

Is this the behaviour you want, or should it be different?