Skip to content
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

Adding empty/null check for file upload #407

Open
harshitkathuria opened this issue Jan 29, 2023 · 0 comments
Open

Adding empty/null check for file upload #407

harshitkathuria opened this issue Jan 29, 2023 · 0 comments

Comments

@harshitkathuria
Copy link

For a file upload (v-file-input) component, we have an option for removing the selected file.
Actual Behaviour:
But here, when we remove the selected file from file upload input, we get an error stating
TypeError: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob', and state remains the same.
Expected Behaviour:
The new state value should be empty.

This is because of the current code structure in lib/mixins/FileProperty.js, wherein if there is no file selected, an error is thrown (from getFileDataUrl method), and the input and change method of the file input component is not called, and thus the state remains unchanged.
Perhaps we can include an empty check case when removing the selected file, so that the new state value is updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant