Fixed #847 - Textarea autoresize does not respect its border

pull/880/head
Cagatay Civici 2021-01-20 12:44:12 +03:00
parent 19379998a3
commit 5f87373590
1 changed files with 2 additions and 1 deletions

View File

@ -21,8 +21,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.overflowY = "scroll";