Cannot listen for Livewire events if component placed inside Filament widget

26 Views Asked by At

I am trying to place a Livewire component inside a Filament Widget while also using inline scripts. I have this inside my Livewire Component blade file:

@script
<script>
    console.log('started');
    document.addEventListener('livewire:init', function () {
        console.log('loaded');
    });
</script>
@endscript

It prints started but not loaded. However if I take the component and just render it on a page by itself without Filament, it does print loaded. Since Widgets build on top of Livewire components, I figured this would work out of the box, but can't get it to work.

0

There are 0 best solutions below