diff --git a/src/renderers/dom/shared/DOMPropertyOperations.js b/src/renderers/dom/shared/DOMPropertyOperations.js index 809102ea556a8..364ca58d10f7b 100644 --- a/src/renderers/dom/shared/DOMPropertyOperations.js +++ b/src/renderers/dom/shared/DOMPropertyOperations.js @@ -158,7 +158,7 @@ var DOMPropertyOperations = { } else if (propertyInfo.hasBooleanValue || (propertyInfo.hasOverloadedBooleanValue && value === true)) { node.setAttribute(attributeName, ''); - } else if (attributeName === 'value' && node.hasAttribute('value')) { + } else if (attributeName === 'value') { // Use loose coercion to prevent replacement on comparisons like // '3e1' == 30 in Chrome (~52). if (node.value != value) { // eslint-disable-line diff --git a/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js b/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js index b75eb9bfe23b6..6261294001735 100644 --- a/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js +++ b/src/renderers/dom/shared/__tests__/DOMPropertyOperations-test.js @@ -346,6 +346,16 @@ describe('DOMPropertyOperations', function() { expect(stubNode.className).toBe(''); }); + it('should not update numeric values when the input.value is loosely the same', function() { + stubNode.setAttribute('type', 'number'); + stubNode.value = '3e1'; + + spyOn(stubNode, 'setAttribute'); + + DOMPropertyOperations.setValueForProperty(stubNode, 'value', 30); + + expect(stubNode.setAttribute.calls.count()).toBe(0); + }); }); describe('deleteValueForProperty', function() {