mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Make sure DOM components work in JSDOM
This commit is contained in:
@@ -103,7 +103,9 @@ var ReactDOMInput = ReactCompositeComponent.createClass({
|
||||
|
||||
var value = this.getValue();
|
||||
if (value != null) {
|
||||
DOMPropertyOperations.setValueForProperty(rootNode, 'value', value);
|
||||
// Cast `value` to a string to ensure the value is set correctly. While
|
||||
// browsers typically do this as necessary, jsdom doesn't.
|
||||
DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -113,7 +113,9 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
|
||||
componentDidUpdate: function(prevProps, prevState, rootNode) {
|
||||
var value = this.getValue();
|
||||
if (value != null) {
|
||||
DOMPropertyOperations.setValueForProperty(rootNode, 'value', value);
|
||||
// Cast `value` to a string to ensure the value is set correctly. While
|
||||
// browsers typically do this as necessary, jsdom doesn't.
|
||||
DOMPropertyOperations.setValueForProperty(rootNode, 'value', '' + value);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user