diff --git a/components/input/Input.jsx b/components/input/Input.jsx index b598cafbc..24ddf1fe0 100644 --- a/components/input/Input.jsx +++ b/components/input/Input.jsx @@ -124,6 +124,7 @@ export default { }, handleChange(e) { + if (e.target.composing) return; this.setValue(e.target.value, e); }, @@ -237,6 +238,7 @@ export default { ]); const { stateValue, getInputClassName, handleKeyDown, handleChange, $listeners } = this; const inputProps = { + directives: [{ name: 'ant-input' }], domProps: { value: fixControlledValue(stateValue), }, @@ -251,7 +253,6 @@ export default { ref: 'input', key: 'ant-input', }; - inputProps.directives = [{ name: 'ant-input' }]; return this.renderLabeledIcon(prefixCls, ); }, }, @@ -263,8 +264,9 @@ export default { attrs: this.$attrs, on: { ...$listeners, - change: this.handleChange, + input: this.handleChange, keydown: this.handleKeyDown, + change: noop, }, directives: [ { diff --git a/components/input/TextArea.jsx b/components/input/TextArea.jsx index 1b42e399c..4ff2c40d7 100644 --- a/components/input/TextArea.jsx +++ b/components/input/TextArea.jsx @@ -116,6 +116,7 @@ export default { }, handleTextareaChange(e) { + if (e.target.composing) return; if (!hasProp(this, 'value')) { this.stateValue = e.target.value; this.resizeTextarea(); @@ -163,6 +164,7 @@ export default { }); const textareaProps = { + directives: [{ name: 'ant-input' }], attrs: { ...otherProps, ...$attrs }, on: { ...$listeners, @@ -171,9 +173,6 @@ export default { change: noop, }, }; - if ($listeners['change.value']) { - textareaProps.directives = [{ name: 'ant-input' }]; - } return (