mirror of
https://github.com/youzan/vant.git
synced 2025-10-16 08:00:34 +00:00
[bugfix]: textarea filed height incorrect when display none
This commit is contained in:
@@ -89,7 +89,10 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
if (this.autosize && this.type === 'textarea') {
|
if (this.autosize && this.type === 'textarea') {
|
||||||
const el = this.$refs.textarea;
|
const el = this.$refs.textarea;
|
||||||
el.style.height = el.scrollHeight + 'px';
|
const scrollHeight = el.scrollHeight;
|
||||||
|
if (scrollHeight !== 0) {
|
||||||
|
el.style.height = scrollHeight + 'px';
|
||||||
|
}
|
||||||
el.style.overflowY = 'hidden';
|
el.style.overflowY = 'hidden';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user