Skip to content

Commit 001bd82

Browse files
fix: add target composing judge
1 parent 401709c commit 001bd82

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

components/input/Input.jsx

+6-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default {
3939
const { value, defaultValue } = this.$props;
4040
return {
4141
stateValue: !hasProp(this, 'value') ? defaultValue : value,
42-
isComposing: false
42+
isComposing: false,
4343
};
4444
},
4545
watch: {
@@ -123,7 +123,9 @@ export default {
123123
},
124124

125125
handleChange(e) {
126-
this.setValue(e.target.value, e);
126+
if (!e.target.composing) {
127+
this.setValue(e.target.value, e);
128+
}
127129
},
128130
handleComposition(e) {
129131
if (e.type === 'compositionstart') {
@@ -247,7 +249,7 @@ export default {
247249
input: handleChange,
248250
change: noop,
249251
compositionstart: handleComposition,
250-
compositionend: handleComposition
252+
compositionend: handleComposition,
251253
},
252254
class: getInputClassName(prefixCls),
253255
ref: 'input',
@@ -270,7 +272,7 @@ export default {
270272
change: handleChange,
271273
keydown: handleKeyDown,
272274
compositionstart: handleComposition,
273-
compositionend: handleComposition
275+
compositionend: handleComposition,
274276
},
275277
directives: [
276278
{

0 commit comments

Comments
 (0)