Skip to content

Commit

Permalink
Fixed #900 - Textarea autoresize does not respect its border
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Jan 28, 2021
1 parent 35a3e43 commit 3544062
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/textarea/Textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 3544062

Please sign in to comment.