-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File Select Callback invoked before a file is selected #585
Comments
Yes this is the expected behaviour. To be able to cancel the selected file when the user cancels the file select pop up the model will be set to empty when the user clicks on the file upload. This way if you cancel the popup your model will be in sync with the file input. That empty file event could be used to show custom messages or disable the form submission. |
Thanks for clarifying. |
@danialfarid we've just upgraded to the latest release and have found that the behaviour described above has changed slightly. Previously the
Now when we upload a file by clicking the element, then click it again (to upload another file) the callback is invoked passing null. I could of course update our handlers like so:
But I just wanted some clarification on the change. Is there any way to prevent the callback from firing when nothing has been selected or will it always be invoked when going from Thanks |
You can specify |
Thanks again for clarifying. |
I recently updated to 3.0.7 and am experiencing a problem I'm pretty sure did not experience prior to the upgrade.
This Plunk demonstrates the issue. The first time the page loads the file selected callback is not invoked until a file is actually selected. If you click the Choose File button again, the callback is invoked immediately. This has the effect of posting an empty files array to the callback which is causing our uploads to fail.
I know I should check the files array before attempting an upload but I was curious if this is the expected behaviour?
The text was updated successfully, but these errors were encountered: