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
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.
Yeh, trying to digg the source code to find the cause at the moment but thought to check if someone got a solution. 😄
i think its actually a delay in filepond emitting the event that tells us a file was dropped
Yes, indeed. Right now the button gets disabled on
FilePond:processfilestart
event but for a better UX this should happen on FilePond:addfilestart
event.Wanna PR?
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. 😄
When you fork it, you can just run ‘npm run build’. The npm commands are listed in the root package.json file.
Yeh, trying to follow the contribution mini tutorial on the github. 🙂
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.
hm, maybe you got any clue of why npm run build fails here?
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.Did you set up a repository in your apps’s composer.json to point to your local version.?
yes I did. The local package is used by my app.
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.