[TextField] unable to specify inputClassName and apply props to input element #9508
Labels
breaking change
component: text field
This is the name of the generic UI component, not the React module!
While answering a question on StackOverflow I ran into an issue:
In order to pass props to the input element via the TextField component, you need to specify an
inputProps
object within theInputProps
property. This is fine, except for the fact that the current implementation of TextField sets its own value forinputProps
so that theinputClassName
is applied to the input element.By handing your own value of
inputProps
to TextField, you will overwrite the value applied by TextField, leaving inputClassName unset.As of today, the only way to use both is to include
inputClassName
in the inner inputProps object.Expected Behavior
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.Current Behavior
If you specify
inputClassName
and includeinputProps
withinInputProps
, the class will not be applied to the input element.Steps to Reproduce (for bugs)
See this codesandbox for a reproduction of this issue
The text was updated successfully, but these errors were encountered: