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

TextField does not pass disabled status to InputLabel & FormHelperText #12487

Closed
2 tasks done
WreckedArrow opened this issue Aug 12, 2018 · 1 comment
Closed
2 tasks done
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@WreckedArrow
Copy link
Contributor

  • This is a v1.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Passing the disabled prop to a TextField should also apply the disabled style to the label and helper text.

Current Behavior

Only the Input component is disabled.

Steps to Reproduce

Link: https://codesandbox.io/s/403p55597

  1. Create a TextField and pass it the disabled prop.
  2. Wrap an Input, InputLabel, and FormHelperText in a FormControl, and pass it the disabled prop.
  3. The TextField's label and helper text will not have the disabled style.

Context

It's a minor issue since the disabled prop can be manually passed within the TextField using InputLabelProps, etc., but I found the current behavior surprising. In the source, I believe the disabled prop should be given to FormControl like the error and required props, unless there is some need to isolate disabled to only the Input.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work good first issue Great for first contributions. Enable to learn the contribution process. component: text field This is the name of the generic UI component, not the React module! labels Aug 12, 2018
@oliviertassinari
Copy link
Member

@WreckedArrow Well spotted, we should be able to fix the issue by removing the special handling of the disabled property in the TextField component.
https://github.com/mui-org/material-ui/blob/f21551ec742e99871177d9ef998a183e1b5e3933/packages/material-ui/src/TextField/TextField.js#L85

Do you want to work on it? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

No branches or pull requests

2 participants