© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
JibayMcs

On closing a slide-over modal unable to listen to "close-modal" event

Hi !

I'm using a custom modal, by calling :
<x-filament::modal slide-over sticky-header sticky-footer width="5xl" id="my-modal">

<p>Here's my content</p>

</x-filament::modal>
<x-filament::modal slide-over sticky-header sticky-footer width="5xl" id="my-modal">

<p>Here's my content</p>

</x-filament::modal>


But on listening to the
close-modal
close-modal
event nothing happens.

Here the JS code:

document.addEventListener('livewire:initialized', () => {
  Livewire.on('close-modal', ({id}) => {
  
      console.log('close-modal');
  
      if (id === 'my-modal') {
          Livewire.dispatch('bot::unsubscribe');
      }
  });
});
document.addEventListener('livewire:initialized', () => {
  Livewire.on('close-modal', ({id}) => {
  
      console.log('close-modal');
  
      if (id === 'my-modal') {
          Livewire.dispatch('bot::unsubscribe');
      }
  });
});


Is this a Filament bug, or have I missed something?

Thanks for you help !

Best regards.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Modal | Slide Over
FilamentFFilament / ❓┊help
3y ago
How to close notification slide-over on action
FilamentFFilament / ❓┊help
2y ago
Listen to specific custom modal event
FilamentFFilament / ❓┊help
2y ago
Prevent Modal from closing on a specific event
FilamentFFilament / ❓┊help
3y ago