Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Controlled inputs do not synchronize value or checked attribute #10150
This commit is a follow up to prior work to resolve issues with number inputs in React:
More or less
A can of worms :). The discussion above concluded that React should not synchronize the value attribute/checked attribute for controlled inputs. This PR makes that change.
Currently, inputs keep their value/checked attribute in sync with the value/checked property. This is a React behavior. Traditionally browser DOM manipulation does not rely on keeping the value/checked attribute in sync.
It's also very problematic for number inputs and (I believe) a few other obscure input bugs in IE/iOS Safari (this needs to be confirmed). After discussion, it was decided to make a breaking change to no longer sync up the value/checked attribute with it's associated property.
For this to work, I made the following changes:
How to test this change
I've pushed a build of this version of React for our DOM fixtures here:
referenced this pull request
Jul 11, 2017
@gaearon I think it would need to touch on:
Yes, part of the reasoning was just attribute syncing, but it also got conflated with the
Yes, very much so IMHO. This is not "native behavior" that you can normally rely on.