Capgemini / dcx-react-library

React Library UI/UX agnostic
https://main--6069a6f47f4b9f002171f8e1.chromatic.com
MIT License
113 stars 7 forks source link

fix: reset character count on focus #443

Closed szilvihorvath closed 1 year ago

szilvihorvath commented 1 year ago

Issue: https://github.com/Capgemini/dcx-react-library/issues/437

Character count is reset on focus. So after the textarea has been cleared programmatically, and then the textarea is focussed, the counter and the message will be reset to the correct value.

This is not the perfect solution as the count and message is not updated on clicking the button that clears the form.

daniele-zurico commented 1 year ago

I suggest exposing a function called reset() that will move the component back to his original state

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (a511277) 100.00% compared to head (ae3f6de) 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/0.7 #443 +/- ## ============================================= Coverage 100.00% 100.00% ============================================= Files 50 50 Lines 1093 1114 +21 Branches 439 442 +3 ============================================= + Hits 1093 1114 +21 ``` | [Impacted Files](https://codecov.io/gh/Capgemini/dcx-react-library/pull/443?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Capgemini) | Coverage Δ | | |---|---|---| | [src/characterCount/CharacterCount.tsx](https://codecov.io/gh/Capgemini/dcx-react-library/pull/443?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Capgemini#diff-c3JjL2NoYXJhY3RlckNvdW50L0NoYXJhY3RlckNvdW50LnRzeA==) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Capgemini). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Capgemini)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.