File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -199,8 +199,9 @@ var ReactDOMInput = {
199
199
var node = ReactDOMComponentTree . getNodeFromInstance ( inst ) ;
200
200
var value = LinkedValueUtils . getValue ( props ) ;
201
201
if ( value != null ) {
202
- // To avoid side effects (such as losing text selection), only set value if changed
203
- if ( value != node . value ) {
202
+ // Use loose coercion to prevent replacement on comparisons like
203
+ // '3e1' == 30 in Chrome (~52).
204
+ if ( value != node . value ) { // eslint-disable-line
204
205
// Cast `value` to a string to ensure the value is set correctly. While
205
206
// browsers typically do this as necessary, jsdom doesn't.
206
207
node . value = '' + value ;
Original file line number Diff line number Diff line change @@ -159,7 +159,9 @@ var DOMPropertyOperations = {
159
159
( propertyInfo . hasOverloadedBooleanValue && value === true ) ) {
160
160
node . setAttribute ( attributeName , '' ) ;
161
161
} else if ( attributeName === 'value' && node . hasAttribute ( 'value' ) ) {
162
- if ( node . value != value ) {
162
+ // Use loose coercion to prevent replacement on comparisons like
163
+ // '3e1' == 30 in Chrome (~52).
164
+ if ( node . value != value ) { // eslint-disable-line
163
165
node . setAttribute ( attributeName , '' + value ) ;
164
166
}
165
167
} else {
You can’t perform that action at this time.
0 commit comments