Skip to content

Commit e5391de

Browse files
author
tangjinzhou
committed
fix: input trigger change at ie #2203
1 parent 7557ac9 commit e5391de

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

antdv-demo

components/input/Input.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default {
6666
const props = this.$props;
6767
const value = typeof props.value === 'undefined' ? props.defaultValue : props.value;
6868
return {
69-
stateValue: value,
69+
stateValue: typeof value === 'undefined' ? '' : value,
7070
};
7171
},
7272
watch: {
@@ -172,7 +172,8 @@ export default {
172172
},
173173
handleChange(e) {
174174
const { value, composing } = e.target;
175-
if (composing && this.lazy) return;
175+
// https://github.com/vueComponent/ant-design-vue/issues/2203
176+
if ((composing && this.lazy) || this.stateValue === value) return;
176177
this.setValue(value, this.clearPasswordValueAttribute);
177178
resolveOnChange(this.$refs.input, e, this.onChange);
178179
},

components/input/TextArea.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default {
2828
data() {
2929
const value = typeof this.value === 'undefined' ? this.defaultValue : this.value;
3030
return {
31-
stateValue: value,
31+
stateValue: typeof value === 'undefined' ? '' : value,
3232
};
3333
},
3434
computed: {},
@@ -68,7 +68,7 @@ export default {
6868
},
6969
handleChange(e) {
7070
const { value, composing } = e.target;
71-
if (composing || this.stateValue === value) return;
71+
if ((composing && this.lazy) || this.stateValue === value) return;
7272

7373
this.setValue(e.target.value, () => {
7474
this.$refs.resizableTextArea.resizeTextarea();

0 commit comments

Comments
 (0)