TextInput Column Save with Confirmation
Hi. I am using Filament v3 Table TextInput Column. When I take cursor away from it , it autosaves the value. Is there a way to ask user for confirmation before saving or save after a button is clicked in actions etc. Thanks for help.
9 Replies
Not as far as I am aware, for v3 you could try: requiresConfirmation() but I am pretty sure it wouldn't work there tbh.
How to check if there are any lifecycle hooks for this?
@toeknee It has the concern CanUpdateState and we can use updateStateUsing to modify how it saves the data. Is there a way to show confirmation modal before saving the data from that function.
I'm afraid I don't thinkso at this level as you would need to have that for each input. You'd likely be better cloning the field and adding support for requiresConfirmation()
I have modified how it update states. It shows a notification and if the users click Cancel it emits an event to Self. How can I listen for that event in Filament?
If you are using the notification, why not have the notification actions handle the save/cancel?
Don't know how to do that. Can you guide? I know how to dispatch actions from notifications but where to write logic on what to do when that action is clicked?
I am using dispatchSelf here but where should I place my listener code? Docs doesn't say that.
How do you mean? You just add the ->actions to the notifcation you are sending? I assume you are using Filament Notifications