Component not firing events in some render hooks
I have the following render hook set up in the boot method in: app/Providers/Filament/AdminPanelProvider.php
This renders a simple component in: resources/views/livewire/publish-staff-button.blade.php
With the following method in the component class: app/Livewire/PublishStaffButton.php
Now if the render hook is in 'panels::global-search.start' then it will work but messes up the global search results (no idea why) but if it is in 'global-search.before' no events are fired.
Any ideas?
Solution:Jump to solution
ok, so I have managed to get it working by just wrapping the button in a div, it seems as though it doesn't work when it is the root element!?
```
<div>
<x-filament::button wire:click="publishStaff">
{{$label}}...
2 Replies
Also, I have no idea why I have to dispatch an event at all, i would have thought I could just use wire:click='publishStaff' from the component but this seems to be called agains the x-filament::button itself
Solution
ok, so I have managed to get it working by just wrapping the button in a div, it seems as though it doesn't work when it is the root element!?