appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.89k stars 466 forks source link

[Vue] Custom component and clear filter doesn't work #912

Closed javialon26 closed 5 years ago

javialon26 commented 5 years ago

Issue Type: Enhancement/Bug

Platform: Vue

Description: Use selected filters component with a custom reactive search component and try to clear all filters or remove the custom filter.

Current behavior: The result list remains without changes. (with the last custom filter applied) Expected behavior: The result list must be updated.

Minimal reproduction of the problem with instructions: https://codesandbox.io/embed/z33kl8p1ml?fontsize=14

Reactivesearch version: 1.0.0-beta9

bietkul commented 5 years ago

@metagrover Any idea how to do that? I was also getting the same issue.

metagrover commented 5 years ago

Since it's a custom component, you will have to manually check for the updated selectedValue (which should be null) in props, and then fire a null query via given setQuery method in your child component.

javialon26 commented 5 years ago

@metagrover I think this is a workaround. I achieve the same behavior with the clean event in the selected filter component but in the react example this works out of the box.

See: https://opensource.appbase.io/reactive-manual/advanced/reactivecomponent.html#examples

metagrover commented 5 years ago

@bietkul can you check on this? Both variants should be consistent.

bietkul commented 5 years ago

@javialon26 It is working with Vue too. https://codesandbox.io/embed/z33kl8p1ml?fontsize=14

davidkong0987 commented 4 years ago

Is it just me or does this no longer work? or perhaps I'm on an old version

dominicpedro commented 2 years ago

This is still not working, clearing the filters is not resetting the custom components query. the query-changed event does not fire and in fact no events fire when clearing on the reactive-component.