-
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(react): added counter to textinput and storybook updates #12139
feat(react): added counter to textinput and storybook updates #12139
Conversation
it('should not render counter with only enableCounter prop passed in', () => { | ||
expect( | ||
counterTestWrapper1.exists(`${prefix}--text-area__counter`) | ||
).toEqual(false); | ||
}); | ||
|
||
it('should not render element without only maxCount prop passed in', () => { | ||
it('should not render counter with only maxCount prop passed in', () => { |
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.
Wording fixes
<TextInput | ||
{...args} | ||
labelText="Text input label" | ||
helperText="Optional help text" | ||
id="text-input-1" | ||
type="text" | ||
/> |
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.
Added playground storybook to test
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.
Nice, thanks for adding that in @TannerS! We'll need to define the args somewhere in the storybook; take a look at FluidTextInput
for an example:
Playground.argTypes = {
placeholder: {
control: {
type: 'text',
},
defaultValue: 'Placeholder text',
}
...
...
...
};
There are some props that don't apply to FluidTextInput
but do to TextInput
, so it may not be a complete list. I believe you can copy most of these over to the TextArea
story as well
✅ Deploy Preview for carbon-components-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Thanks for taking the time to contribute this, Tanner! Just had a few comments.
Everything else looks great so far 💪🏻 |
right now stopping at the limit is the current way textarea works. originally it was an idea but bouncing around the design with @abbeyhrt at the time, we thought using the native html input's/textarea's
not sure what you mean but if you want this change ill gladly add it ;D
in response to this comment, #12139 (comment), ill make the change but i dont understand the change lol, playground works as is, what does the thank you |
Makes sense, if it's mirroring
Just wondering if the counter should align to the bottom of the container, cc @carbon-design-system/design
I'm seeing them all show up, but some aren't working properly. I am not able to change |
For sake of examples here is both @tw15egan please see this and the above comment, i went ahead with this change until told otherwise :D |
…n into tanner_addCounterTextInput
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 👍 ✅
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.
Hi @TannerS sorry for the late review. 👋
As @tw15egan mentioned above, yes, we want to align the counter in the bottom right above the input when the label wraps to multiple lines. Also yes we want to have the same functionality for text area and text input when adding the counter for right now. I also agree we do not want to have a counter on the password variant of text input.
Eventually, the design team may look into both of these counter designs for text area/text input and do some more research and design iterations. Looks good to me!
Closes #
#11179
#1672
#5702
but it has been said this code change should be fine
CC: @aledavila
Changelog
New
Changed
Testing / Reviewing