Skip to content

Commit

Permalink
fix(Textarea): resolve row count calculation errors caused by scrollb…
Browse files Browse the repository at this point in the history
…ar (#2040)

Co-authored-by: Romain Hamel <[email protected]>
  • Loading branch information
Mini-ghost and romhml authored Sep 6, 2024
1 parent b1f691f commit 8210936
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/runtime/components/forms/Textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ export default defineComponent({
}
textarea.value.rows = props.rows
const overflow = textarea.value.style.overflow
textarea.value.style.overflow = 'hidden'
const styles = window.getComputedStyle(textarea.value)
const paddingTop = parseInt(styles.paddingTop)
Expand All @@ -166,6 +168,8 @@ export default defineComponent({
if (newRows > props.rows) {
textarea.value.rows = props.maxrows ? Math.min(newRows, props.maxrows) : newRows
}
textarea.value.style.overflow = overflow
}
}
Expand Down

0 comments on commit 8210936

Please sign in to comment.