Skip to content

Commit 948499a

Browse files
committed
fix: input trigger multiple change event
1 parent b2d6577 commit 948499a

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

components/input/Input.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import inputProps from './inputProps'
55
import { hasProp, getComponentFromProp, getStyle, getClass } from '../_util/props-util'
66
import { isIE, isIE9 } from '../_util/env'
77

8+
function noop () {}
9+
810
function fixControlledValue (value) {
911
if (typeof value === 'undefined' || value === null) {
1012
return ''
@@ -184,6 +186,7 @@ export default {
184186
...$listeners,
185187
keydown: handleKeyDown,
186188
input: handleChange,
189+
change: noop,
187190
},
188191
class: classNames(getInputClassName(), getClass(this)),
189192
ref: 'input',

components/input/TextArea.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function fixControlledValue (value) {
2525
}
2626
return value
2727
}
28+
function noop () {}
2829

2930
export default {
3031
name: 'ATextarea',
@@ -165,6 +166,7 @@ export default {
165166
...$listeners,
166167
keydown: handleKeyDown,
167168
input: handleTextareaChange,
169+
change: noop,
168170
},
169171
}
170172
if ($listeners['change.value']) {

0 commit comments

Comments
 (0)