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

If I set a className for max width on TextInput the invalid wrapper extends past it #5208

Closed
1 of 2 tasks
scottdickerson opened this issue Jan 29, 2020 · 5 comments
Closed
1 of 2 tasks

Comments

@scottdickerson
Copy link
Contributor

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Detailed description

Describe in detail the issue you're having.
I used the className prop of the TextInput to set a maxWidth on the input field for certain TextInput types. It works! Unfortunately if the TextInput is invalid, the wrapper class highlights extend way beyond the max width of the Text Input. Can we also send the className prop along on the wrapper, or give a separate wrapper class prop that we can override?

Is this issue related to a specific component?
TextInput

Additional information

image

@emyarod
Copy link
Member

emyarod commented Jan 29, 2020

would you mind creating a reduced test case in Code Sandbox for easier testing and debugging?

@scottdickerson
Copy link
Contributor Author

sure no problem:
https://codesandbox.io/s/textinput-example-47zv7 @emyarod

@tw15egan
Copy link
Collaborator

Confirmed. Seems like this is solved by passing the class down the wrapper instead of the input itself. Seems like this would be considered a breaking change since some users could be sending down a class they want to send to the input, so we may need to add a new prop to allow adding classes to the wrapper.

@emyarod emyarod assigned emyarod and unassigned emyarod Jan 31, 2020
@emyarod
Copy link
Member

emyarod commented Feb 11, 2020

since the wrapper element is still modifiable with an alternate selector I think that would be the workaround in this case. not sure if there's a definite fix for this

@sstrubberg
Copy link
Member

Fixed with v11.

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

No branches or pull requests

5 participants