Use getSelection in IE where available

IE9+ has support for window.getSelection, but we’re still using
document.selection for IE9/10. Only use the old IE selection API if the
modern one is unavailable.
This commit is contained in:
Isaac Salier-Hellendag
2014-12-03 14:03:26 -08:00
parent b1971a7e27
commit 6b46e80bb9
+5 -1
View File
@@ -189,7 +189,11 @@ function setModernOffsets(node, offsets) {
}
}
var useIEOffsets = ExecutionEnvironment.canUseDOM && document.selection;
var useIEOffsets = (
ExecutionEnvironment.canUseDOM &&
'selection' in document &&
!('getSelection' in window)
);
var ReactDOMSelection = {
/**