From 96709926e899d3cfbcb14fdad879f3cf1c1fa58e Mon Sep 17 00:00:00 2001 From: John Date: Sun, 11 Apr 2021 08:27:39 +0800 Subject: [PATCH] fix(input): `v-model` modifiers not work (#3817) * fix(input): `v-model` modifiers not work * refactor: update --- components/input/Input.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/input/Input.jsx b/components/input/Input.jsx index 33aec9f10..926be43e8 100644 --- a/components/input/Input.jsx +++ b/components/input/Input.jsx @@ -88,6 +88,15 @@ export default { } }, 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() { this.$refs.input.focus(); }, @@ -152,6 +161,7 @@ export default { keydown: handleKeyDown, input: handleChange, change: noop, + blur: this.onBlur, }, class: getInputClassName(prefixCls, size, disabled), ref: 'input', @@ -196,6 +206,7 @@ export default { input: this.handleChange, keydown: this.handleKeyDown, change: noop, + blur: this.onBlur, }, }; return