File tree 2 files changed +6
-9
lines changed
2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -199,14 +199,11 @@ var ReactDOMInput = {
199
199
var node = ReactDOMComponentTree . getNodeFromInstance ( inst ) ;
200
200
var value = LinkedValueUtils . getValue ( props ) ;
201
201
if ( value != null ) {
202
-
203
- // Cast `value` to a string to ensure the value is set correctly. While
204
- // browsers typically do this as necessary, jsdom doesn't.
205
- var newValue = '' + value ;
206
-
207
202
// To avoid side effects (such as losing text selection), only set value if changed
208
- if ( newValue !== node . value ) {
209
- node . value = newValue ;
203
+ if ( value != node . value ) {
204
+ // Cast `value` to a string to ensure the value is set correctly. While
205
+ // browsers typically do this as necessary, jsdom doesn't.
206
+ node . value = '' + value ;
210
207
}
211
208
} else {
212
209
if ( props . value == null && props . defaultValue != null ) {
Original file line number Diff line number Diff line change @@ -158,8 +158,8 @@ var DOMPropertyOperations = {
158
158
} else if ( propertyInfo . hasBooleanValue ||
159
159
( propertyInfo . hasOverloadedBooleanValue && value === true ) ) {
160
160
node . setAttribute ( attributeName , '' ) ;
161
- } else if ( attributeName === 'value' ) {
162
- if ( node . value !== value ) {
161
+ } else if ( attributeName === 'value' && node . hasAttribute ( 'value' ) ) {
162
+ if ( node . value != value ) {
163
163
node . setAttribute ( attributeName , '' + value ) ;
164
164
}
165
165
} else {
You can’t perform that action at this time.
0 commit comments