Textarea does not auto resize its height when created #733
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
As title, create a Textarea with
:autoResize=true
and its model to contain some large text.The Textarea will only adjust its height after the contents of the textarea dom element is changed by the user (so that its scrollheight is affected, e.g. by entering a newline)
Initially,
this.cachedScrollHeight
is falsy, so that it will be set tothis.$el.scrollHeight
byprimevue/src/components/textarea/Textarea.vue
Line 26 in 5323d88
Then, the code block following:
primevue/src/components/textarea/Textarea.vue
Line 30 in 5323d88
won't be executed, which results in the height of $el not being set to the scrollHeight.
The fix for this issue is simple, just remove:
primevue/src/components/textarea/Textarea.vue
Line 26 in 5323d88
That way, the height of $el will be adjusted, as
this.cachedScrollHeight !== this.$el.scrollHeight
The text was updated successfully, but these errors were encountered: