Is there any way to ask user confirmation before file is removed from FileUpload field?
I did not find any way to to ask the user a confirmation pop up when user click on
X
icon in the form. Is there any way to do so?10 Replies
I doubt it, but check if requiresConfirmation() exists on the field
The
requiresConfirmation
method exits on the action, and not on the field. The file pond do. have a beforeRemoveFile
callback, but I am not sure how can I hook it into JS.Maybe some insight at https://pqina.nl/filepond/docs/api/instance/events/ if you can find the right even to listen to you can tigger a Filament notification via JS.
Easy File Uploading With JavaScript | FilePond
A JavaScript library that can upload anything you throw at it, optimizes images for faster uploads, and offers a great, accessible, silky smooth user experience.
Thanks, I figured out that I can override the FilePond field and create my own view and in that view, I can have something like the below in JS
What I want now is that is there any way to fire up the native confirmation action that Filament has. for e.g like
requiresConfirmation
?there is not a way to do that, no
I agree that it’s really needed
Checkout the docs. You can fire notifications from JavaScript.
Maybe dans right though.
awaiting a yes/no response is the tricky part
Yea, I can see that.
Yes, for notification it's possible. But for the confirmation pop-up, as of now, it's not possible as mentioned. I will try to figure it out if I can find a way. Thanks for the help