Skip to content

Commit

Permalink
Reduce number of mouse events disabable. Formatting in isIteractive()
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Sep 3, 2016
1 parent 1ac8c5b commit 8fb7749
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/renderers/dom/client/eventPlugins/SimpleEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ function getDictionaryKey(inst) {
}

function isInteractive(tag) {
return tag === 'button' || tag === 'input'
|| tag === 'textarea' || tag === 'select';
return tag === 'button' || tag === 'input' ||
tag === 'textarea' || tag === 'select';
}

function shouldPreventMouseEvent(inst) {
Expand Down Expand Up @@ -225,17 +225,18 @@ var SimpleEventPlugin = {
return null;
}
/* falls through */
case 'topContextMenu':
case 'topDoubleClick':
case 'topMouseDown':
case 'topMouseMove':
case 'topMouseOut':
case 'topMouseOver':
case 'topMouseUp':
// Disabled elements should not respond to mouse events
if (shouldPreventMouseEvent(targetInst)) {
return null;
}
/* falls through */
case 'topMouseOut':
case 'topMouseOver':
case 'topContextMenu':
EventConstructor = SyntheticMouseEvent;
break;
case 'topDrag':
Expand Down

0 comments on commit 8fb7749

Please sign in to comment.