diff --git a/src/runtime/components/forms/Input.vue b/src/runtime/components/forms/Input.vue index 150a8e0d7f..55f4f3d60d 100644 --- a/src/runtime/components/forms/Input.vue +++ b/src/runtime/components/forms/Input.vue @@ -205,16 +205,19 @@ export default defineComponent({ } const onChange = (event: Event) => { - const value = (event.target as HTMLInputElement).value - emit('change', value) - - if (modelModifiers.value.lazy) { - updateInput(value) - } - - // Update trimmed input so that it has same behavior as native input https://github.com/vuejs/core/blob/5ea8a8a4fab4e19a71e123e4d27d051f5e927172/packages/runtime-dom/src/directives/vModel.ts#L63 - if (modelModifiers.value.trim) { - (event.target as HTMLInputElement).value = value.trim() + if (props.type === 'file') { + const value = (event.target as HTMLInputElement).files + emit('change', value) + } else { + const value = (event.target as HTMLInputElement).value + emit('change', value) + if (modelModifiers.value.lazy) { + updateInput(value) + } + // Update trimmed input so that it has same behavior as native input https://github.com/vuejs/core/blob/5ea8a8a4fab4e19a71e123e4d27d051f5e927172/packages/runtime-dom/src/directives/vModel.ts#L63 + if (modelModifiers.value.trim) { + (event.target as HTMLInputElement).value = value.trim() + } } } diff --git a/src/runtime/components/forms/SelectMenu.vue b/src/runtime/components/forms/SelectMenu.vue index 212bddba84..38bd6fad48 100644 --- a/src/runtime/components/forms/SelectMenu.vue +++ b/src/runtime/components/forms/SelectMenu.vue @@ -63,7 +63,7 @@ autofocus autocomplete="off" :class="uiMenu.input" - @change="onChange" + @change="onQueryChange" />