diff --git a/src/components/form-file/form-file.js b/src/components/form-file/form-file.js index 08384bede71..0af40f22b2e 100644 --- a/src/components/form-file/form-file.js +++ b/src/components/form-file/form-file.js @@ -169,15 +169,16 @@ export const BFormFile = /*#__PURE__*/ Vue.extend({ } }, reset() { + // IE 11 doesn't support setting `$input.value` to `''` or `null` + // So we use this little extra hack to reset the value, just in case + // This also appears to work on modern browsers as well + // Wrapped in try in case IE 11 or mobile Safari crap out try { - // Wrapped in try in case IE 11 craps out - this.$refs.input.value = '' + const $input = this.$refs.input + $input.value = '' + $input.type = '' + $input.type = 'file' } catch (e) {} - // IE 11 doesn't support setting `input.value` to '' or null - // So we use this little extra hack to reset the value, just in case. - // This also appears to work on modern browsers as well. - this.$refs.input.type = '' - this.$refs.input.type = 'file' this.selectedFile = this.multiple ? [] : null }, onFileChange(evt) {