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] - Warning in TextField if disabled=true and no onChange is provided #432

Closed
MichalWadowski opened this issue Jul 3, 2017 · 0 comments
Labels
Milestone

Comments

@MichalWadowski
Copy link

If I create TextField element with disabled={true} attribute, but without onChange, I receive warning:
Warning: Failed prop type: You provided a `value` prop to the TextField without a `onChange` handler. This will render a read only field. Set either the `onChange` or use the `defaultValue` instead.

If component is disabled, then there is no sense to define onChange, because its read only field by definition.

@mlaursen mlaursen added the bug label Jul 10, 2017
@mlaursen mlaursen added this to the v1.0.17 milestone Jul 10, 2017
mlaursen added a commit that referenced this issue Jul 12, 2017
The controlled prop validation will now ignore the disabled prop as
well. So the validation will not fail if the readOnly or disabled props
are enabled on a component.

Closes #432
@mlaursen mlaursen changed the title Warning in TextField if disabled=true and no onChange is provided [TextField] - Warning in TextField if disabled=true and no onChange is provided Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants