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

Controlled inputs do not synchronize value or checked attribute #10150

Closed

Commits on Jul 11, 2017

  1. Controlled inputs do not synchronize value or checked attribute

    This commit is a follow up to prior work to resolve issues with number
    inputs in React. 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. After discussion, it was
    decided to make a breaking change to no longer sync up the
    value/checked attribute with it's assoicated property.
    
    For this to work, I made the following changes:
    
    - The value, defaultValue, checked and defaultChecked properties are
      now maintained within the HTML property config.
    - This required adding a filter to strip out the value property on
      selects and textareas
    - The logic to defer assignment of the value attribute has been
      removed form ChangeEventPlugin
    - defaultValue and defaultChecked are aliased to `value` and `checked`
      so that uncontrolled input attribute assignment works as intended.
    nhunzaker committed Jul 11, 2017
    Copy the full SHA
    094ba20 View commit details
    Browse the repository at this point in the history