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
toeknee10mo 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
tinkypinky10mo 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
toeknee10mo 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
tinkypinky10mo 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
toeknee10mo ago
If you are using the notification, why not have the notification actions handle the save/cancel?
tinkypinky
tinkypinky10mo 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
tinkypinky10mo ago
I am using dispatchSelf here but where should I place my listener code? Docs doesn't say that.
toeknee
toeknee10mo 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
More Posts