Skip to content

Commit

Permalink
fix(VFileInput): bug in Safari where file is not added (#8498)
Browse files Browse the repository at this point in the history
* fix(VFileInput): bug in Safari where file is not added

Safari does not seem to emit an input event when selecting a file, even though
from what I can see the HTML spec says both an input and change event should
be emitted.

closes #7941

* chore(VFileInput): update comment
  • Loading branch information
nekosaur authored and johnleider committed Aug 15, 2019
1 parent c67b666 commit 0b4a970
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/vuetify/src/components/VFileInput/VFileInput.ts
Expand Up @@ -161,6 +161,13 @@ export default VTextField.extend({

input.data!.domProps!.value = this.internalFileInput

// This solves an issue in Safari where
// nothing happens when adding a file
// do to the input event not firing
// https://github.com/vuetifyjs/vuetify/issues/7941
delete input.data!.on!.input
input.data!.on!.change = this.onInput

return [this.genSelections(), input]
},
genPrependSlot () {
Expand Down

0 comments on commit 0b4a970

Please sign in to comment.