Is it possible to disable "Save changes" button sooner once FileUpload detects file input?

I am not sure if this is by design but "Save changes" button is disabled too late and often results in user performing save action before file completes uploading. Is there a way to disable "Save changes" right when there is a file input detected?
14 Replies
Dennis Koch
Dennis Koch2y ago
If you find a way, please do a PR 😅 not sure whether this is triggered by alpine or livewire. If it’s LW there’s no way around it.
Crylar
CrylarOP2y ago
Yeh, trying to digg the source code to find the cause at the moment but thought to check if someone got a solution. 😄
Dan Harrin
Dan Harrin2y ago
i think its actually a delay in filepond emitting the event that tells us a file was dropped
Crylar
CrylarOP2y ago
Yes, indeed. Right now the button gets disabled on FilePond:processfilestart event but for a better UX this should happen on FilePond:addfilestart event.
Dennis Koch
Dennis Koch2y ago
Wanna PR?
Crylar
CrylarOP2y ago
Sure, just need to find out of how to compile the package assets, so I could properly test this. I am just couple of weeks in filament but enjoying it. 😄
awcodes
awcodes2y ago
When you fork it, you can just run ‘npm run build’. The npm commands are listed in the root package.json file.
Crylar
CrylarOP2y ago
Yeh, trying to follow the contribution mini tutorial on the github. 🙂
awcodes
awcodes2y ago
Best thing to do is to fork it and also pull down the demo and run your local fork as a repository for your local copy of the demo. Or just use it for your own app. Lol.
Crylar
CrylarOP2y ago
hm, maybe you got any clue of why npm run build fails here?
Crylar
CrylarOP2y ago
I have forked filament inside my app. I did npm install inside the forked directory, and running npm run build. I have latest npm installed too.
awcodes
awcodes2y ago
Did you set up a repository in your apps’s composer.json to point to your local version.?
Crylar
CrylarOP2y ago
yes I did. The local package is used by my app.
Crylar
CrylarOP2y ago
https://github.com/filamentphp/filament/pull/6182 I have create PR to solve the issue. Unfortunately processfiles event is bugged in FilePond when there is a File loaded already and does not get triggered when all complete processing, so made a simple workaround by checking if there are still files being processed in the queue on every processfile event before triggering the final file-upload-finished event. I have tested this with single and multiple files. Let me know.
GitHub
Improved handling of file-upload-started/finished events for FileUp...
Before the improvement "Save changes" button was disabled too late and often resulted in user performing save action before file completed uploading.
Want results from more Discord servers?
Add your server