Textarea autoresize does not respect its border #847
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
vue2-portable
Milestone
The size of the Textarea in autoresize mode is calculated by:
primevue/src/components/textarea/Textarea.vue
Line 25 in 754131d
An elements scrollHeight, however, just returns the content height + padding. It does not include the border, see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight
As
box-sizing
is set toborder-box
$el.style.height will set the height including the border, so that the border height is missing for the content, cutting off characters like ag
at the bottom in Firefox for me.The correct way to set the height is to calculate the needed space including the border,e.g. like so instead:
This fixes the issue and should calculate the correct height in a standard way.
The text was updated successfully, but these errors were encountered: