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
[TextField] Remove inputClassName property #9509
Conversation
inputClassName should be applied to the input element whether InputProps includes inputProps or not. The one exception would be if the inner inputProps includes a className prop as well.
Maybe the solution is to remove |
@oliviertassinari that would be cleaner. If that's the consensus, I'll update the PR. |
I debated removing But, I do know where I stand, and that is with clarity. I would kill all of these synthetic props and only allow you to pass via the upper case component props itself. I'm sure I could be convinced to expose things for high use scenarios, but otherwise anything advanced should just be through the upper case component props. |
@rosskevin I agree with you. InputProps should be enough for TextField. inputProps should be enough for Input. The subset of input attributes that have been added to both of these components is incomplete and will always cause confusion. Maybe some have merit, like name, but I share your stance on this. |
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.
Let's make things simpler :)
@oliviertassinari all set, thanks again. |
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.
It's perfect 👌
Fixes #9508
For TextField,
inputClassName
should be applied to the input element whetherInputProps
includesinputProps
or not. The one exception would be if the innerinputProps
includes aclassName
prop as well.Breaking change
The existing
InputProps
property can be used to set the className on the input element, makinginputClassName
redundant. Issue #9508 exposed some conflicting behavior between the two properties and it was decided that removinginputClassName
would result in a cleaner API.The configuration of the wrapped Input component and its input element should be done through
InputProps
. To specify a className on the input element: