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

Fixed uncaught TypeError for file input #2055

Merged
merged 1 commit into from Dec 1, 2020

Conversation

kevinblackdesk
Copy link
Contributor

@kevinblackdesk kevinblackdesk commented Nov 19, 2020

Current code throws an error whenever you click on an <input type="file" wire:model="photo">

Uncaught TypeError: Cannot set property 'value' of undefined
    at HTMLInputElement.clearFileInputValue (FileUploads.js:37)
clearFileInputValue @ FileUploads.js:37

This is because this is undefined, since we want to clear the value of the element we can just use the el variable instead.


Closes #2091

Current code throws an error whenever you click on an `<input type="file" wire:model="photo">`
```
Uncaught TypeError: Cannot set property 'value' of undefined
    at HTMLInputElement.clearFileInputValue (FileUploads.js:37)
clearFileInputValue @ FileUploads.js:37
```

This is because `this` is `undefined`, since we want to clear the value of the element we can just use the `el` variable instead.
@kevinblackdesk kevinblackdesk changed the title Update FileUploads.js Fixed uncaught TypeError for file input Nov 19, 2020
@divdax
Copy link

divdax commented Nov 30, 2020

I noticed this error too. Please meeerge @calebporzio 😄

@elmagox
Copy link

elmagox commented Nov 30, 2020

How can I get these changes in my project?

@Eignerth
Copy link

Eignerth commented Dec 1, 2020

Yes How can get these changes in my project?

@calebporzio calebporzio merged commit 7a23ca7 into livewire:master Dec 1, 2020
@calebporzio
Copy link
Collaborator

Thanks @kevinblackdesk !

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

Successfully merging this pull request may close these issues.

FileUpload.js TypeError: Cannot set property 'value' of undefined
5 participants