Skip to content

Commit 9670992

Browse files
authored
fix(input): v-model modifiers not work (vueComponent#3817)
* fix(input): `v-model` modifiers not work * refactor: update
1 parent e95eb61 commit 9670992

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

components/input/Input.jsx

+11
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ export default {
8888
}
8989
},
9090
methods: {
91+
onBlur(e) {
92+
// fix this isssue: https://github.com/vueComponent/ant-design-vue/issues/3816
93+
// reference: https://github.com/vuejs/vue/issues/5847 and https://github.com/vuejs/vue/issues/8431
94+
this.$forceUpdate();
95+
96+
const { blur } = getListeners(this);
97+
blur && blur(e);
98+
},
99+
91100
focus() {
92101
this.$refs.input.focus();
93102
},
@@ -152,6 +161,7 @@ export default {
152161
keydown: handleKeyDown,
153162
input: handleChange,
154163
change: noop,
164+
blur: this.onBlur,
155165
},
156166
class: getInputClassName(prefixCls, size, disabled),
157167
ref: 'input',
@@ -196,6 +206,7 @@ export default {
196206
input: this.handleChange,
197207
keydown: this.handleKeyDown,
198208
change: noop,
209+
blur: this.onBlur,
199210
},
200211
};
201212
return <TextArea {...textareaProps} ref="input" />;

0 commit comments

Comments
 (0)