© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
Andrew Wallo

Custom Event interfering with Filament Notification. Help needed!

In many of my components, I have a Notification sent and another event that refreshes the data in my custom Navigation menu. The custom navigation menu is connected to a Filament render hook in the boot method of a service provider as seen here:
Filament::registerRenderHook(
           'global-search.start',
            static fn (): View => view('filament-companies::components.dropdown.navigation-menu'),
);
Filament::registerRenderHook(
           'global-search.start',
            static fn (): View => view('filament-companies::components.dropdown.navigation-menu'),
);


Here is an example of one of my components that emits the Notification and the custom event to refresh the data in the navigation menu:
public function updateCompanyName(UpdatesCompanyNames $updater): void
{
    $this->resetErrorBag();

    $updater->update($this->user, $this->company, $this->state);

    $name = $this->state['name'];

    $this->dispatchBrowserEvent('refresh-navigation-menu');

    Notification::make()
        ->title(__('Company name updated'))
        ->success()
        ->body(__('Your company has been successfully updated'))
        ->send();
}
public function updateCompanyName(UpdatesCompanyNames $updater): void
{
    $this->resetErrorBag();

    $updater->update($this->user, $this->company, $this->state);

    $name = $this->state['name'];

    $this->dispatchBrowserEvent('refresh-navigation-menu');

    Notification::make()
        ->title(__('Company name updated'))
        ->success()
        ->body(__('Your company has been successfully updated'))
        ->send();
}


In my navigation menu blade component, I use a script to catch the event to refresh the component's data as seen here:
<script>
  window.addEventListener('refresh-navigation-menu', () => {
      @this.call('$refresh');
  });
</script>
<script>
  window.addEventListener('refresh-navigation-menu', () => {
      @this.call('$refresh');
  });
</script>


I have tried many different ways to do this, but this worked. Instead of using the
dispatchBrowserEvent()
dispatchBrowserEvent()
method, I have also used the
emit()
emit()
method with a similar script used in the blade component, which also works, but the same issue with the Notification occurs either way. The issue is...is that the event somehow interferes with the Notification and causes a type of Lagging/dragging movement with the notification event box which is sort of noticeable as seen in the video. If the "refresh-navigation-menu" event is not used, the notification is obviously smooth.

How could I go about fixing this?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Help Needed with ToggleButtons in Filament Form
FilamentFFilament / ❓┊help
2y ago
Help Needed: Issues with Filament Custom User Approval and Logout Redirection
FilamentFFilament / ❓┊help
17mo ago
Interact with Event in custom livewire component with filament table
FilamentFFilament / ❓┊help
3y ago
Filament - Custom Modal - Help
FilamentFFilament / ❓┊help
2y ago