mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
fix(Textarea): resolve row count calculation errors caused by scrollbar (#2040)
Co-authored-by: Romain Hamel <rom.hml@gmail.com>
This commit is contained in:
@@ -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)
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user