F
Filament2mo ago
Juan

Form FileUpload cancel hook

Hey there! I would like to know if it is possible to "hook" an action to a FileUpload for the cancel button... something like ->onCancelPressed... Thanks!
8 Replies
Mohamed Ayaou
Mohamed Ayaou2mo ago
the FileUpload is built upon Filepond js, so you may create a custom JS code to fire its cancel button
Juan
JuanOP2mo ago
Thanks! Do you know the name of the event that the cancel button fires, I've tried looking it up but I am not able to find it?
Mohamed Ayaou
Mohamed Ayaou2mo ago
You can inspect the cancel button in the dev tools and list all the event listeners on it
Juan
JuanOP2mo ago
ok,I'll try. Thanlks! Dude, No idea where's the event name for the cancel button... too much...
awcodes
awcodes2mo ago
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.
Juan
JuanOP2mo ago
Ok! Thanks!! I'm lost. I registered the event with FileUpload->registerListeners and the event "FilePond:processfileabort" but the code (just a dump) doesn't get executed... Maybe I'm missing something?
awcodes
awcodes2mo ago
FilePond isn’t livewire. You’ll need to listen for it in js.
Juan
JuanOP2mo ago
ok! thanks! Hey again. Still working on this... If I change the code of FilePond, I maybe breaking future updates, am I?

Did you find this page helpful?