Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New props suggestions "counter" and "limit" and "showRemaining" for the Textarea component #1959

Open
seahindeniz opened this issue Nov 11, 2020 · 1 comment

Comments

@seahindeniz
Copy link
Contributor

seahindeniz commented Nov 11, 2020

Hi

What do you think about support for 3 additional, value + event related props?

counter prop is for adding a counter at the bottom right corner of the textarea to show, how many characters was entered.
limit prop is for limiting option to have a character limit on the component. This is kind a useful when input needs to be limited to a pre-defined number.
showRemaining prop, can be a side prop for limit in order to show how many characters remain. Something like, 28/100 to show 28 characters of 100 left.

Type definition:

| {
    limit?: null;
  }
| {
    limit: number;
    showRemaining: boolean;
  }
@coderitual
Copy link
Contributor

Hey @seahindeniz , let me discuss that with the team as at first glance it looks like introducing unnecessary complexity to the low level visual only component.

Regarding typing we are moving away from ambiguous union types for component props since they are not handled properly in doc generators and parsers (eg in storybook).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants