@samitouri / QOS-React / commits / fc04310792

Fix #7099 (#7251)

* Set step prop before value prop * Embed comments on .step sequence behavior

Troy DeMonbreun committed Jul 13, 2016 at 15:28 UTC fc0431079272c8de0207f465f09691d155e870b8
2 files changed +8 -3
src/renderers/dom/client/wrappers/ReactDOMInput.js
+3
@@ -64,6 +64,9 @@ var ReactDOMInput = {
64 // Make sure we set .type before any other properties (setting .value
65 // before .type means .value is lost in IE11 and below)
66 type: undefined,
67 + // Make sure we set .step before .value (setting .value before .step
68 + // means .value is rounded on mount, based upon step precision)
69 + step: undefined,
70 }, DisabledInputUtils.getHostProps(inst, props), {
71 defaultChecked: undefined,
72 defaultValue: undefined,
src/renderers/dom/client/wrappers/__tests__/ReactDOMInput-test.js
+5 -3
@@ -727,7 +727,7 @@ describe('ReactDOMInput', function() {
727 );
728 });
729
730 - it('sets type before value always', function() {
730 + it('sets type and step before value always', function() {
731 if (!ReactDOMFeatureFlags.useCreateElement) {
732 return;
733 }
@@ -749,12 +749,14 @@ describe('ReactDOMInput', function() {
749 return el;
750 });
751
752 - ReactTestUtils.renderIntoDocument(<input value="hi" type="radio" />);
753 - // Setting value before type does bad things. Make sure we set type first.
752 + ReactTestUtils.renderIntoDocument(<input value="0" type="range" min="0" max="100" step="1" />);
753 expect(log).toEqual([
754 'set data-reactroot',
755 'set type',
756 + 'set step',
757 'set value',
758 + 'set min',
759 + 'set max',
760 'set value',
761 'set checked',
762 'set checked',