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 (nuxt#2040)

Co-authored-by: Romain Hamel <[email protected]>
  • Loading branch information
2 people authored and patrick-hofmann committed Oct 3, 2024
1 parent c176627 commit 0a28c9e
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 0a28c9e

Please sign in to comment.