diff --git a/src/renderers/dom/client/wrappers/ReactDOMInput.js b/src/renderers/dom/client/wrappers/ReactDOMInput.js index d8730c2a21c84..fa553306c3655 100644 --- a/src/renderers/dom/client/wrappers/ReactDOMInput.js +++ b/src/renderers/dom/client/wrappers/ReactDOMInput.js @@ -64,6 +64,9 @@ var ReactDOMInput = { // Make sure we set .type before any other properties (setting .value // before .type means .value is lost in IE11 and below) type: undefined, + // Make sure we set .step before .value (setting .value before .step + // means .value is rounded on mount, based upon step precision) + step: undefined, }, DisabledInputUtils.getHostProps(inst, props), { defaultChecked: undefined, defaultValue: undefined, diff --git a/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js b/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js index 0e80605b2c791..8108f8934e167 100644 --- a/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js +++ b/src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js @@ -727,7 +727,7 @@ describe('ReactDOMInput', function() { ); }); - it('sets type before value always', function() { + it('sets type and step before value always', function() { if (!ReactDOMFeatureFlags.useCreateElement) { return; } @@ -749,12 +749,14 @@ describe('ReactDOMInput', function() { return el; }); - ReactTestUtils.renderIntoDocument(); - // Setting value before type does bad things. Make sure we set type first. + ReactTestUtils.renderIntoDocument(); expect(log).toEqual([ 'set data-reactroot', 'set type', + 'set step', 'set value', + 'set min', + 'set max', 'set value', 'set checked', 'set checked',