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
toeknee
toeknee15mo ago
Not as far as I am aware, for v3 you could try: requiresConfirmation() but I am pretty sure it wouldn't work there tbh.
tinkypinky
tinkypinkyOP15mo ago
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.
toeknee
toeknee15mo ago
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()
tinkypinky
tinkypinkyOP15mo ago
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?
toeknee
toeknee15mo ago
If you are using the notification, why not have the notification actions handle the save/cancel?
tinkypinky
tinkypinkyOP15mo ago
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?
tinkypinky
tinkypinkyOP15mo ago
I am using dispatchSelf here but where should I place my listener code? Docs doesn't say that.
toeknee
toeknee15mo ago
How do you mean? You just add the ->actions to the notifcation you are sending? I assume you are using Filament Notifications
Want results from more Discord servers?
Add your server