Skip to content

Commit

Permalink
Merge pull request facebook#771 from spicyj/facebookgh-694
Browse files Browse the repository at this point in the history
Don't get selection if no active element
  • Loading branch information
yungsters committed Jan 10, 2014
2 parents 8dbc530 + 7a9e544 commit dea6063
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/eventPlugins/SelectEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ function getSelection(node) {
*/
function constructSelectEvent(nativeEvent) {
// Ensure we have the right element, and that the user is not dragging a
// selection (this matches native `select` event behavior).
if (mouseDown || activeElement != getActiveElement()) {
// selection (this matches native `select` event behavior). In HTML5, select
// fires only on input and textarea thus if there's no focused element we
// won't dispatch.
if (mouseDown ||
activeElement == null ||
activeElement != getActiveElement()) {
return;
}

Expand Down

0 comments on commit dea6063

Please sign in to comment.