Skip to content

Commit

Permalink
initialValue in Input wrapperState is always a string
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Nov 12, 2017
1 parent 8c1343d commit 077ed23
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/react-dom/src/client/ReactDOMFiberInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import {getFiberCurrentPropsFromNode} from './ReactDOMComponentTree';
import ReactControlledValuePropTypes from '../shared/ReactControlledValuePropTypes';

type InputWithWrapperState = HTMLInputElement & {
value: string,
defaultValue: string,
_wrapperState: {
initialValue: ?string,
initialValue: string,
initialChecked: ?boolean,
controlled?: boolean,
},
Expand Down Expand Up @@ -300,7 +302,11 @@ function updateNamedCousins(rootNode, props) {
// when the user is inputting text
//
// https://github.com/facebook/react/issues/7253
function synchronizeDefaultValue(node: Element, type: ?string, value: string) {
function synchronizeDefaultValue(
node: InputWithWrapperState,
type: ?string,
value: string,
) {
if (
// Focused number inputs synchronize on blur. See ChangeEventPlugin.js
(type !== 'number' || node.ownerDocument.activeElement !== node) &&
Expand Down

0 comments on commit 077ed23

Please sign in to comment.