diff --git a/docs/en-US/component/input.md b/docs/en-US/component/input.md
index 45f8e33ce1..6305be354e 100644
--- a/docs/en-US/component/input.md
+++ b/docs/en-US/component/input.md
@@ -156,19 +156,19 @@ input/length-limiting
### Events
-| Name | Description | Type |
-| ----------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
-| blur | triggers when Input blurs | ^[Function]`(event: FocusEvent) => void` |
-| focus | triggers when Input focuses | ^[Function]`(event: FocusEvent) => void` |
-| change | triggers when the input box loses focus or the user presses Enter, only if the modelValue has changed | ^[Function]`(value: string \| number) => void` |
-| input | triggers when the Input value change | ^[Function]`(value: string \| number) => void` |
-| clear | triggers when the Input is cleared by clicking the clear button | ^[Function]`() => void` |
-| keydown | triggers when a key is pressed down | ^[Function]`(event: KeyboardEvent \| Event) => void` |
-| mouseleave | triggers when the mouse leaves the Input element | ^[Function]`(event: MouseEvent) => void` |
-| mouseenter | triggers when the mouse enters the Input element | ^[Function]`(event: MouseEvent) => void` |
-| compositionstart | triggers when the composition starts | ^[Function]`(event: CompositionEvent) => void` |
-| compositionupdate | triggers when the composition is updated | ^[Function]`(event: CompositionEvent) => void` |
-| compositionend | triggers when the composition ends | ^[Function]`(event: CompositionEvent) => void` |
+| Name | Description | Type |
+| ----------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
+| blur | triggers when Input blurs | ^[Function]`(event: FocusEvent) => void` |
+| focus | triggers when Input focuses | ^[Function]`(event: FocusEvent) => void` |
+| change | triggers when the input box loses focus or the user presses Enter, only if the modelValue has changed | ^[Function]`(value: string \| number, evt?: Event) => void` |
+| input | triggers when the Input value change | ^[Function]`(value: string \| number) => void` |
+| clear | triggers when the Input is cleared by clicking the clear button | ^[Function]`() => void` |
+| keydown | triggers when a key is pressed down | ^[Function]`(event: KeyboardEvent \| Event) => void` |
+| mouseleave | triggers when the mouse leaves the Input element | ^[Function]`(event: MouseEvent) => void` |
+| mouseenter | triggers when the mouse enters the Input element | ^[Function]`(event: MouseEvent) => void` |
+| compositionstart | triggers when the composition starts | ^[Function]`(event: CompositionEvent) => void` |
+| compositionupdate | triggers when the composition is updated | ^[Function]`(event: CompositionEvent) => void` |
+| compositionend | triggers when the composition ends | ^[Function]`(event: CompositionEvent) => void` |
### Slots
diff --git a/packages/components/input/__tests__/input.test.tsx b/packages/components/input/__tests__/input.test.tsx
index 052fd62dfb..6278639dab 100644
--- a/packages/components/input/__tests__/input.test.tsx
+++ b/packages/components/input/__tests__/input.test.tsx
@@ -638,6 +638,16 @@ describe('Input.vue', () => {
})
})
+ test('input change event return Event parameter', async () => {
+ const onChange = vi.fn()
+ const wrapper = mount(() => )
+
+ await wrapper.find('input').trigger('change')
+ await nextTick()
+
+ expect(onChange).toHaveBeenCalledWith('', expect.any(Event))
+ })
+
test('modelValue modifiers', async () => {
const number = ref()
const trim = ref()
diff --git a/packages/components/input/src/input.ts b/packages/components/input/src/input.ts
index 7b7757c4de..365e67dcf2 100644
--- a/packages/components/input/src/input.ts
+++ b/packages/components/input/src/input.ts
@@ -230,7 +230,8 @@ export type InputPropsPublic = __ExtractPublicPropTypes
export const inputEmits = {
[UPDATE_MODEL_EVENT]: (value: string) => isString(value),
input: (value: string) => isString(value),
- change: (value: string) => isString(value),
+ change: (value: string, evt?: Event) =>
+ isString(value) && (evt instanceof Event || evt === undefined),
focus: (evt: FocusEvent) => evt instanceof FocusEvent,
blur: (evt: FocusEvent) => evt instanceof FocusEvent,
clear: () => true,
diff --git a/packages/components/input/src/input.vue b/packages/components/input/src/input.vue
index 8e9d35fde6..8ec1af0a7e 100644
--- a/packages/components/input/src/input.vue
+++ b/packages/components/input/src/input.vue
@@ -395,7 +395,7 @@ const setNativeInputValue = () => {
const formatterValue = props.formatter
? props.formatter(nativeInputValue.value)
: nativeInputValue.value
- if (!input || input.value === formatterValue) return
+ if (!input || input.value === formatterValue || props.type === 'file') return
input.value = formatterValue
}
@@ -458,7 +458,7 @@ const handleChange = async (event: Event) => {
if (props.modelModifiers.lazy) {
emit(UPDATE_MODEL_EVENT, value)
}
- emit(CHANGE_EVENT, value)
+ emit(CHANGE_EVENT, value, event)
await nextTick()
setNativeInputValue()