Skip to content

Commit

Permalink
Fix for #7170 (#7486)
Browse files Browse the repository at this point in the history
* Write failing test

* Ensure .min and .max are set before .value

* Adjusting test for false negative

* Revert test adjustment (apparently it was only failing locally)
  • Loading branch information
troydemonbreun authored and aweary committed Aug 15, 2016
1 parent 9a48b5c commit 3013afe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/renderers/dom/client/wrappers/ReactDOMInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ var ReactDOMInput = {
// Make sure we set .step before .value (setting .value before .step
// means .value is rounded on mount, based upon step precision)
step: undefined,
// Make sure we set .min & .max before .value (to ensure proper order
// in corner cases such as min or max deriving from value, e.g. Issue #7170)
min: undefined,
max: undefined,
}, DisabledInputUtils.getHostProps(inst, props), {
defaultChecked: undefined,
defaultValue: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ describe('ReactDOMInput', function() {
);
});

it('sets type and step before value always', function() {
it('sets type, step, min, max before value always', function() {
if (!ReactDOMFeatureFlags.useCreateElement) {
return;
}
Expand All @@ -769,10 +769,10 @@ describe('ReactDOMInput', function() {
'set data-reactroot',
'set type',
'set step',
'set value',
'set min',
'set max',
'set value',
'set value',
'set checked',
'set checked',
]);
Expand Down

0 comments on commit 3013afe

Please sign in to comment.