Disable second click to remove filter

Currently, when clicking the filters within any of the Filter widgets a second time, it removes the clicked filter. Is it possible to disable that second click behavior? So the final functionality would be any time you click a link within those filter widgets it would only select that filter, not remove it if you were to click it again.

This is for a specific layout I’m building where the client wants the Clear Filters widget to be the only way to remove the selected filters.

This does not really sound like good user experience to me, but if that makes sense in that layout, you could probably add an event listener, and disable the input after clicking.

However what you make sounds like a great candidate for the new Connectors of InstantSearch v2. You control yourself in initial render to make your widget, and then you can add event listeners that only fire once to do the refinement.

Check it out in the announcement and the documentation

1 Like

I agree it’s not great for flat filter lists but in the hierarchical widget it can be confusing for a user to click 2-3 levels down, then when trying to click back to the parent filter it instead removes all of them.

I’ll take a look at the connectors to see if that would be a way to solve it, thanks!

1 Like