Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

angauber's avatar

How to watch for nova 'reset filters' event on custom filter ?

Hello

I am currently building a nova custom Filter but I am stuck with an issue. I cannot figure out how does the global RESET FILTERS button works.

I have looked into the nova source code and it does emit an event in nova/resources/js/components/FilterMenu.vue

@click="$emit('clear-selected-filters')"

I tried to attach it to my filter like so @clear-selected-filters="myMethod" but with no luck.

Can I listen for that event on my custom nova filter ? if so how can I do so ?

Best regards. Antoine.

0 likes
3 replies
bugsysha's avatar

Only if the event bus is global. Try looking more at source code and what objects are present in global window scope.

KasparRosin's avatar

Ran into a similar issue when trying to call a custom function when reset filters is clicked. Found this to be a solution to my issue. Because nova commits updateFilterState when clicking reset filters, listening to the action seems to be the only option.

created() {
    this.$store.subscribeAction((action, state) => {
      if (action.type === `${this.resourceName}/resetFilterState`) {
        this.doSomething();
      }
    });
  },
1 like
elev8studio's avatar

Thank you so much! This issue has been driving me nuts and your solution has solved the problem for me. I'm working on a project that's built using Laravel Nova and I'm shocked by how sparse the Nova documentation is. It's very unlike Laravel - their main docs are so good!

Please or to participate in this conversation.