Skip to content

Commit

Permalink
--amend
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Aug 1, 2016
1 parent 151bc11 commit 1e2a9ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderers/dom/shared/DOMPropertyOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ var DOMPropertyOperations = {
} else if (propertyInfo.hasBooleanValue ||
(propertyInfo.hasOverloadedBooleanValue && value === true)) {
node.setAttribute(attributeName, '');
} else if (attributeName === 'value') {
} else if (attributeName === 'value' && node.hasAttribute('value')) {
// Use loose coercion to prevent replacement on comparisons like
// '3e1' == 30 in Chrome (~52).
if (node.value != value) { // eslint-disable-line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ describe('DOMPropertyOperations', function() {

it('should not update numeric values when the input.value is loosely the same', function() {
stubNode.setAttribute('type', 'number');
stubNode.setAttribute('value', '3e1');
// Keep in sync. The comparison occurs between setAttribute and value.
stubNode.value = '3e1';

spyOn(stubNode, 'setAttribute');
Expand Down

0 comments on commit 1e2a9ab

Please sign in to comment.