File tree 1 file changed +12
-1
lines changed
packages/vuetify/src/components/VFileInput
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { VChip } from '../VChip'
11
11
import { PropValidator } from 'vue/types/options'
12
12
13
13
// Utilities
14
- import { humanReadableFileSize , wrapInArray } from '../../util/helpers'
14
+ import { deepEqual , humanReadableFileSize , wrapInArray } from '../../util/helpers'
15
15
import { consoleError } from '../../util/console'
16
16
17
17
export default VTextField . extend ( {
@@ -141,6 +141,17 @@ export default VTextField.extend({
141
141
} ,
142
142
immediate : true ,
143
143
} ,
144
+ value ( v ) {
145
+ const value = this . isMultiple ? v : v ? [ v ] : [ ]
146
+ if ( ! deepEqual ( value , this . $refs . input . files ) ) {
147
+ // When the input value is changed programatically, clear the
148
+ // internal input's value so that the `onInput` handler
149
+ // can be triggered again if the user re-selects the exact
150
+ // same file(s). Ideally, `input.files` should be
151
+ // manipulated directly but that property is readonly.
152
+ this . $refs . input . value = ''
153
+ }
154
+ } ,
144
155
} ,
145
156
146
157
methods : {
You can’t perform that action at this time.
0 commit comments