fix: input trigger multiple change event
parent
b2d6577b76
commit
948499a730
|
@ -5,6 +5,8 @@ import inputProps from './inputProps'
|
||||||
import { hasProp, getComponentFromProp, getStyle, getClass } from '../_util/props-util'
|
import { hasProp, getComponentFromProp, getStyle, getClass } from '../_util/props-util'
|
||||||
import { isIE, isIE9 } from '../_util/env'
|
import { isIE, isIE9 } from '../_util/env'
|
||||||
|
|
||||||
|
function noop () {}
|
||||||
|
|
||||||
function fixControlledValue (value) {
|
function fixControlledValue (value) {
|
||||||
if (typeof value === 'undefined' || value === null) {
|
if (typeof value === 'undefined' || value === null) {
|
||||||
return ''
|
return ''
|
||||||
|
@ -184,6 +186,7 @@ export default {
|
||||||
...$listeners,
|
...$listeners,
|
||||||
keydown: handleKeyDown,
|
keydown: handleKeyDown,
|
||||||
input: handleChange,
|
input: handleChange,
|
||||||
|
change: noop,
|
||||||
},
|
},
|
||||||
class: classNames(getInputClassName(), getClass(this)),
|
class: classNames(getInputClassName(), getClass(this)),
|
||||||
ref: 'input',
|
ref: 'input',
|
||||||
|
|
|
@ -25,6 +25,7 @@ function fixControlledValue (value) {
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
function noop () {}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ATextarea',
|
name: 'ATextarea',
|
||||||
|
@ -165,6 +166,7 @@ export default {
|
||||||
...$listeners,
|
...$listeners,
|
||||||
keydown: handleKeyDown,
|
keydown: handleKeyDown,
|
||||||
input: handleTextareaChange,
|
input: handleTextareaChange,
|
||||||
|
change: noop,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if ($listeners['change.value']) {
|
if ($listeners['change.value']) {
|
||||||
|
|
Loading…
Reference in New Issue