dxc-technology/halstack-react

[TextArea] Textarea verticalGrow auto doesn't work for programmed updation of value

Closed this issue ยท 5 comments

Describe the bug
Textarea component verticalGrow =auto doesn't work for programmed updation of value

To Reproduce

  1. Add a controlled TextArea component with with value controlled using a state variable.
  2. Use default verticalGrow option as 'auto'.
  3. Add a button, which will replace the content of textarea with a long text using the state variable (> 4 lines).
  4. Click the button to update the content of textarea.
  5. Expectation is height of the textarea should increase upto the size of the content, but it will not increase.
  6. Now click in the textarea, and add any character, then it can be noticed, textarea grows upto content size.

Expected behaviour
Textarea vertical grow auto should grow, irrespective of whether programmatic value update or userkeypress based update.

Screenshots
Added codesandbox link for the issue recreation.

Additional context

  1. Reference Codesandbox link here.
  2. Pls. note, this issue doesn't occur in halstack version 10.1.0. This can be verified by simply changing the version in the codesandbox link mentioned above.
  3. verticalGrow default option is auto.

Add labels
Textarea

Thank you for opening an issue! ๐Ÿš€

Our team will review it as soon as possible. In the meantime, please make sure that you've provided all the necessary details to help us understand and address the issue effectively.

Feel free to contribute and participate in discussions!

After analysis, If the team could provide tentative date/fix version, for this issue, that would be helpful for me.
Thanks in advance.

Hello, @diwakarang!

It's definitely an issue, I've checked. The problem is that the old code in the version you pointed to, while it may have worked, was not the correct code from React's point of view. Let's check it out to find the best possible solution.

Thanks for the feedback!

Hello again, @diwakarang!

We have fixed your issue as we considered it fair enough. We will release a new Halstack patch version with this fix.

Thanks for the patience!

Hi @GomezIvann
Thank you very much for the quick update. ๐Ÿ‘