mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix IE8 disabled input throwing on focus
When IE8 focuses a disabled item, it throws This makes sure the we're not focusing the item during selection restoration/autofocus when the element's disabled.
This commit is contained in:
committed by
Paul O’Shannessy
parent
88a4a566ae
commit
6203e53d16
@@ -21,6 +21,7 @@
|
||||
var ReactDOMSelection = require('ReactDOMSelection');
|
||||
|
||||
var containsNode = require('containsNode');
|
||||
var focusNode = require('focusNode');
|
||||
var getActiveElement = require('getActiveElement');
|
||||
|
||||
function isInDocument(node) {
|
||||
@@ -71,7 +72,7 @@ var ReactInputSelection = {
|
||||
priorSelectionRange
|
||||
);
|
||||
}
|
||||
priorFocusedElem.focus();
|
||||
focusNode(priorFocusedElem);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -19,10 +19,12 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
var focusNode = require('focusNode');
|
||||
|
||||
var AutoFocusMixin = {
|
||||
componentDidMount: function() {
|
||||
if (this.props.autoFocus) {
|
||||
this.getDOMNode().focus();
|
||||
focusNode(this.getDOMNode());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user