From 948499a730c8b574a846e12eccece45ea42f568a Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 7 Jan 2019 20:56:32 +0800 Subject: [PATCH] fix: input trigger multiple change event --- components/input/Input.jsx | 3 +++ components/input/TextArea.jsx | 2 ++ 2 files changed, 5 insertions(+) diff --git a/components/input/Input.jsx b/components/input/Input.jsx index 8863328c8..039132ced 100644 --- a/components/input/Input.jsx +++ b/components/input/Input.jsx @@ -5,6 +5,8 @@ import inputProps from './inputProps' import { hasProp, getComponentFromProp, getStyle, getClass } from '../_util/props-util' import { isIE, isIE9 } from '../_util/env' +function noop () {} + function fixControlledValue (value) { if (typeof value === 'undefined' || value === null) { return '' @@ -184,6 +186,7 @@ export default { ...$listeners, keydown: handleKeyDown, input: handleChange, + change: noop, }, class: classNames(getInputClassName(), getClass(this)), ref: 'input', diff --git a/components/input/TextArea.jsx b/components/input/TextArea.jsx index a488be4a4..fa0465ed9 100644 --- a/components/input/TextArea.jsx +++ b/components/input/TextArea.jsx @@ -25,6 +25,7 @@ function fixControlledValue (value) { } return value } +function noop () {} export default { name: 'ATextarea', @@ -165,6 +166,7 @@ export default { ...$listeners, keydown: handleKeyDown, input: handleTextareaChange, + change: noop, }, } if ($listeners['change.value']) {