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] Add inputProps back #9604
[TextField] Add inputProps back #9604
Conversation
1a2033a
to
dfda1f0
Compare
dfda1f0
to
3943035
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.
I approve, but think we should go further and eliminate all other props that pass through to the input element. Maybe another PR?
@kgregory Oh, you mean the name, value etc? Well, my understanding of the situation is that you will at have a:
The less generic your use case is, the more painful it is to implement. It's all about the right tool for the right job. |
I was thinking of eliminating props that exist only so they can be passed to input, like autoComplete and autoFocus at this level, leaving them to InputProps (or inputProps if we eliminate them from Input as well). Props like name, value, and disabled make sense to keep. |
@kgregory I have been adding those as people were requesting them. What sure is that we shouldn't add more. Now, regarding removing some. I have no certainty, maybe. <Input
autoComplete={autoComplete}
autoFocus={autoFocus}
defaultValue={defaultValue}
disabled={disabled}
multiline={multiline}
name={name}
rows={rows}
rowsMax={rowsMax}
type={type}
value={value}
id={id}
inputRef={inputRef}
onChange={onChange}
placeholder={placeholder}
{...InputProps}
/> |
@oliviertassinari that’s fine, I just felt as though supporting some input attributes would cause confusion. For example, autoFocus is supported, min and max are not. Maybe this can be handled in documentation. We draw a line at the attributes we’ve supported and push people toward inputProps for all others. |
Revert #9382 cc @rosskevin
As suggested by @kgregory how have been dealing with this recurring question on the discussion channels: #9575 (comment)
Providing extra properties to the native input is one of the top actions people are doing with the
TextField
component. We should make it as easy as possible.