From 354406223bd52bef4a852eb5ac7573c823c12882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Thu, 28 Jan 2021 14:56:59 +0300 Subject: [PATCH] Fixed #900 - Textarea autoresize does not respect its border --- src/components/textarea/Textarea.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/textarea/Textarea.vue b/src/components/textarea/Textarea.vue index 45ac80a0de..349c68ef6e 100755 --- a/src/components/textarea/Textarea.vue +++ b/src/components/textarea/Textarea.vue @@ -20,9 +20,9 @@ export default { }, methods: { resize() { - + const style = window.getComputedStyle(this.$el); this.$el.style.height = 'auto'; - this.$el.style.height = this.$el.scrollHeight + 'px'; + this.$el.style.height = `calc(${style.borderTopWidth} + ${style.borderBottomWidth} + ${this.$el.scrollHeight}px)`; if (parseFloat(this.$el.style.height) >= parseFloat(this.$el.style.maxHeight)) { this.$el.style.overflow = "scroll";