Open confirmation modal based on user input in forms
I have lots of complicated forms and sometimes I need to open modal based on user input to check with the user if he's sure about what he is doing or just to make his life easier / make sure he doesn't forget something.
For example:
After changing value of field Y: "Do you want to automatically update field X too?" Y/N buttons
After leaving select, based on DB data: "Item you selected has price in different currency than this invoice, make sure to update it" OK button
I tried to find how to do this in Filament, but found only people asking similar questions getting insufficient answers. Ideally I would need to open it from afterStateUpdated() and that is apparently not possible.
People suggested notifications, I've tried it but those aren't really same thing.
Others suggested Actions, but Actions have to be triggered by user. Invisible Actions which would be automatically triggered by leaving the field are probably closest to what I'm trying to do, but I don't think it's natively possible either.
I'm willing to create it myself, I just want to make sure I'm not missing some obvious way how to do this that already exists.
I'll be also grateful for tips how to achieve this in most elegant way, I have years of experience with Laravel but this is my first big project using Filament.
1 Reply
Maybe using a custom LW component with a modal in the page.
https://filamentphp.com/docs/3.x/support/blade-components/modal/#overview
Pages are LW components as well.
You can use LW events to send data, arguments, etc