-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: text input and textarea character limit counter #2745
feat: text input and textarea character limit counter #2745
Conversation
f38e21f
to
ae08721
Compare
Deploy preview for the-carbon-components ready! Built with commit f38e21f https://deploy-preview-2745--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit f38e21f https://deploy-preview-2745--carbon-components-react.netlify.com |
Deploy preview for the-carbon-components ready! Built with commit 6690dcd https://deploy-preview-2745--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit 6690dcd https://deploy-preview-2745--carbon-components-react.netlify.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 - Thanks @emyarod! One question BTW - Can vanilla text area be used without JavaScript if character counter is not there?
@asudoh yes textarea without character counter can be used without JS also not sure why CI output differs from running vanilla test suite locally |
Cool, BTW the unit test issue seems with FF - Would you want to try it locally ( |
no errors when testing locally on Firefox Nightly (Firefox 68) @asudoh. on Firefox stable (Firefox 66) though, I get the same errors and the spec files are not accessible through dev tools sources either |
@emyarod I think you can put a |
a5481ba
to
34e290d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got done FAST! 🚤 A few small styling fixes:
-
Label got an extra margin bottom when Char count knob is turned on
-
When label text is long, warp to second line before intersecting with Char count. There should be a 16px gap between label and Char count text.
-
When label is hidden, long helper text should push charCount out, but not this far. Should be only a 16px gap between helper text and charCount.
-
CharCount knob visible for Password Input but doesn't do anything. Maybe password input shouldn't have this knob in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fc3d300
to
5d044bb
Compare
@shixiedesign regarding these points:
the 75% max width was the result of a previous ticket, do we want to modify that? #1997 #2000 |
1dbc2c2
to
3aa014c
Compare
@emyarod Thanks double checking! I see, that make sense then. I will strike out that item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! 🎉 Great work. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉 - Thanks @emyarod!
…l state" (carbon-design-system#3106) * Revert "fix: pass `defaultValue` in to textarea and text input initial state (carbon-design-system#3015)" This reverts commit d563edf. * Revert "feat: text input and textarea character limit counter (carbon-design-system#2745)" This reverts commit 919ba2e.
…l state" (carbon-design-system#3106) * Revert "fix: pass `defaultValue` in to textarea and text input initial state (carbon-design-system#3015)" This reverts commit d563edf. * Revert "feat: text input and textarea character limit counter (carbon-design-system#2745)" This reverts commit 919ba2e.
…l state" (carbon-design-system#3106) * Revert "fix: pass `defaultValue` in to textarea and text input initial state (carbon-design-system#3015)" This reverts commit d563edf. * Revert "feat: text input and textarea character limit counter (carbon-design-system#2745)" This reverts commit 919ba2e.
Closes #1672
This PR adds a character counter for
<TextInput>
and<TextArea>
components in both React and vanilla Carbon. The character counter markup can be customized with therenderCharCount
render propChangelog
New
<TextInput>
and<TextArea>
character counterTesting / Reviewing
Ensure the text inputs and textareas function as expected without any regressions (with and without character counters)