Action Modal no afterStateUpdated
I'm trying to call this modal, but nothing is executed when an option is selected
9 Replies
You can't return an action from
afterStateUpdated()
... what are you trying to do specifically?Are you looking for a Notification perhaps?
https://filamentphp.com/docs/3.x/notifications/sending-notifications
He looks like to confirm the user selection, like "it's gonna be dangerous, are you sure to choose that?"
Maybe with
->action(fn () => null)
But this will only show a modal with no action (if it can) πSure but
afterStateUpdated()
is not the place for that. Or did I miss anything?I'm also not sure about afterStateUpdated... Not in front of my laptop to try it, just thinking it might be possible, in addition with a cancel modal action to set the state back to null again..
This should be handled either with a suffixAction() or a separate Actions form field.
If you want to do anything in afterStatedHydrated() you would dispatch and listen to an event. Actions require a trigger and user interaction.
I forgot about the trigger... So, having notification with centered position will be a good filament feature I think.
π
So filament probably doesn't have built-in feature for this, but there must be a workaround to do...
Guys, what I need is that when choosing a certain option in the select, a modal notification opens on the screen stating that it is not possible to continue with the registration. It doesn't need any action just that the notification is modal to lock the screen and only an ok button is available in the modal.
In Notification I didn't find any method to make it modal, so I thought of an Action
Not verified, but what if you do ->call() at the end of the action.