mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
@@ -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 = {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user