fix(input): `v-model` modifiers not work (#3817)
* fix(input): `v-model` modifiers not work * refactor: updatepull/3927/head
parent
e95eb61bcb
commit
96709926e8
|
@ -88,6 +88,15 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onBlur(e) {
|
||||||
|
// fix this isssue: https://github.com/vueComponent/ant-design-vue/issues/3816
|
||||||
|
// reference: https://github.com/vuejs/vue/issues/5847 and https://github.com/vuejs/vue/issues/8431
|
||||||
|
this.$forceUpdate();
|
||||||
|
|
||||||
|
const { blur } = getListeners(this);
|
||||||
|
blur && blur(e);
|
||||||
|
},
|
||||||
|
|
||||||
focus() {
|
focus() {
|
||||||
this.$refs.input.focus();
|
this.$refs.input.focus();
|
||||||
},
|
},
|
||||||
|
@ -152,6 +161,7 @@ export default {
|
||||||
keydown: handleKeyDown,
|
keydown: handleKeyDown,
|
||||||
input: handleChange,
|
input: handleChange,
|
||||||
change: noop,
|
change: noop,
|
||||||
|
blur: this.onBlur,
|
||||||
},
|
},
|
||||||
class: getInputClassName(prefixCls, size, disabled),
|
class: getInputClassName(prefixCls, size, disabled),
|
||||||
ref: 'input',
|
ref: 'input',
|
||||||
|
@ -196,6 +206,7 @@ export default {
|
||||||
input: this.handleChange,
|
input: this.handleChange,
|
||||||
keydown: this.handleKeyDown,
|
keydown: this.handleKeyDown,
|
||||||
change: noop,
|
change: noop,
|
||||||
|
blur: this.onBlur,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
return <TextArea {...textareaProps} ref="input" />;
|
return <TextArea {...textareaProps} ref="input" />;
|
||||||
|
|
Loading…
Reference in New Issue