Skip to content

Commit

Permalink
fix(IE): Fix selection api on IE (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML committed Apr 10, 2018
1 parent 65d3539 commit d6cba84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/utils/domFns.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ export function addUserSelectStyles(doc: ?Document) {
export function removeUserSelectStyles(doc: ?Document) {
try {
if (doc && doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection');
window.getSelection().removeAllRanges(); // remove selection caused by scroll
if (doc.selection) {
// $FlowIgnore: IE
doc.selection.empty();
} else {
window.getSelection().removeAllRanges(); // remove selection caused by scroll
}
} catch (e) {
// probably IE
}
Expand Down

0 comments on commit d6cba84

Please sign in to comment.