Skip to content

Commit

Permalink
Revert ChangeEventPlugin update. See #11746
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Dec 1, 2017
1 parent 94a5cfb commit 696c174
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMFiberInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ function updateNamedCousins(rootNode, props) {
// when the user is inputting text
//
// https://github.com/facebook/react/issues/7253
export function synchronizeDefaultValue(
function synchronizeDefaultValue(
node: InputWithWrapperState,
type: ?string,
value: *,
Expand Down
7 changes: 4 additions & 3 deletions packages/react-dom/src/events/ChangeEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import getEventTarget from './getEventTarget';
import isEventSupported from './isEventSupported';
import {getNodeFromInstance} from '../client/ReactDOMComponentTree';
import * as inputValueTracking from '../client/inputValueTracking';
import {synchronizeDefaultValue} from '../client/ReactDOMFiberInput';

var eventTypes = {
change: {
Expand Down Expand Up @@ -229,15 +228,17 @@ function handleControlledInputBlur(inst, node) {
}

// Fiber and ReactDOM keep wrapper state in separate places
// TODO: Is this still necessary now that Stack is gone?
let state = inst._wrapperState || node._wrapperState;

if (!state || !state.controlled || node.type !== 'number') {
return;
}

// If controlled, assign the value attribute to the current value on blur
synchronizeDefaultValue(node, node.type, node.value);
let value = '' + node.value;
if (node.getAttribute('value') !== value) {
node.setAttribute('value', value);
}
}

/**
Expand Down

0 comments on commit 696c174

Please sign in to comment.