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

Fields with "value" attributes become uneditable after transform #14

Closed
ssorallen opened this issue Jan 7, 2015 · 6 comments · Fixed by #15
Closed

Fields with "value" attributes become uneditable after transform #14

ssorallen opened this issue Jan 7, 2015 · 6 comments · Fixed by #15

Comments

@ssorallen
Copy link
Contributor

In order for "value" to behave as it does in HTML, the created React components must use "defaultValue". "value" in React creates a controlled component, which makes react-magic generate un-editable inputs.

Currently:

> converter.convert('<input value="Darth Vader">')
"<input value="Darth Vader" />
"

To behave as expected:

> converter.convert('<input value="Darth Vader">')
"<input defaultValue="Darth Vader" />
"
@ssorallen
Copy link
Contributor Author

The same goes for type="checkbox" with the checked attribute. It should be converted to defaultChecked.

@aboobakkar
Copy link

the above same issue for me.. and i also checked article https://themeteorchef.com/tutorials/click-to-edit-fields-in-react and deafultValue is not worked thsi,state.something value

@aayushis12
Copy link

The same issue is with me. My Codepen link is https://codepen.io/asinha/pen/EXaZJm?editors=1111 , when I set getInitialValue to '' the input box becomes non-editable

@luanlucho
Copy link

Same issue!

@satishchadokar
Copy link

Same issue for input

@Virksaabnavjot
Copy link

same

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 a pull request may close this issue.

6 participants