diff --git a/src/browser/eventPlugins/SelectEventPlugin.js b/src/browser/eventPlugins/SelectEventPlugin.js index 542dbe5b39..3cfcc020ba 100644 --- a/src/browser/eventPlugins/SelectEventPlugin.js +++ b/src/browser/eventPlugins/SelectEventPlugin.js @@ -69,6 +69,14 @@ function getSelection(node) { start: node.selectionStart, end: node.selectionEnd }; + } else if (window.getSelection) { + var selection = window.getSelection(); + return { + anchorNode: selection.anchorNode, + anchorOffset: selection.anchorOffset, + focusNode: selection.focusNode, + focusOffset: selection.focusOffset + }; } else if (document.selection) { var range = document.selection.createRange(); return { @@ -77,14 +85,6 @@ function getSelection(node) { top: range.boundingTop, left: range.boundingLeft }; - } else { - var selection = window.getSelection(); - return { - anchorNode: selection.anchorNode, - anchorOffset: selection.anchorOffset, - focusNode: selection.focusNode, - focusOffset: selection.focusOffset - }; } }