fix(Field): adjust textarea size when focus/blur (#9718)

This commit is contained in:
neverland 2021-10-24 17:46:12 +08:00 committed by GitHub
parent 24f8919d58
commit 03b33985cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -347,6 +347,8 @@ export default createComponent({
onFocus(event) {
this.focused = true;
this.$emit('focus', event);
// https://github.com/youzan/vant/issues/9715
this.$nextTick(this.adjustSize);
// readonly not work in legacy mobile safari
/* istanbul ignore if */
@ -361,6 +363,7 @@ export default createComponent({
this.updateValue(this.value, 'onBlur');
this.$emit('blur', event);
this.validateWithTrigger('onBlur');
this.$nextTick(this.adjustSize);
resetScroll();
},