dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

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

Closed diwakarang closed 5 months ago

diwakarang commented 5 months ago

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

github-actions[bot] commented 5 months ago

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!

diwakarang commented 5 months ago

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

GomezIvann commented 5 months ago

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!

GomezIvann commented 5 months ago

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!

diwakarang commented 5 months ago

Hi @GomezIvann Thank you very much for the quick update. 👍