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

Convert “value” to “defaultValue” for editable fields #15

Merged
merged 1 commit into from
Jan 8, 2015
Merged

Convert “value” to “defaultValue” for editable fields #15

merged 1 commit into from
Jan 8, 2015

Conversation

ssorallen
Copy link
Contributor

If “value” is set on a React <input> element, the element is not
editable. To match the behavior of HTML where “value” is the starting or
default value, transform the attribute to “defaultValue” to make
<input> elements uncontrolled components[1] by default.

[1] https://facebook.github.io/react/docs/forms.html#uncontrolled-components

Fixes #14.

If “value” is set on a React `<input>` element, the element is not
editable. To match the behavior of HTML where “value” is the starting or
default value, transform the attribute to “defaultValue” to make
`<input>` elements uncontrolled components[1] by default.

[1] https://facebook.github.io/react/docs/forms.html#uncontrolled-components

Fixes #14.
Daniel15 added a commit that referenced this pull request Jan 8, 2015
Convert “value” to “defaultValue” for editable fields
@Daniel15 Daniel15 merged commit 9c627cf into reactjs:master Jan 8, 2015
@Daniel15
Copy link
Member

Daniel15 commented Jan 8, 2015

Thanks!

@ssorallen ssorallen deleted the editable-inputs branch January 8, 2015 23:16
@ihmccd
Copy link

ihmccd commented Oct 8, 2016

Thanks!!!!! I've been looking for hours why my input had became unchangeable, and only here found the answer. Man, thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fields with "value" attributes become uneditable after transform
3 participants