Skip to content

Commit

Permalink
Touch events should be bubbled
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Sep 5, 2018
1 parent ebf431b commit ec4c2e2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/react-dom/src/events/ReactBrowserEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,23 @@ export function listenTo(
const dependency = dependencies[i];

switch (dependency) {
case TOP_SCROLL:
case TOP_WHEEL:
const elementListeners = getListenerTrackingFor(element);

if (!elementListeners.hasOwnProperty(dependency)) {
trapCapturedEvent(dependency, element);
elementListeners[dependency] = true;
}
break;
case TOP_TOUCH_START:
case TOP_TOUCH_END:
case TOP_TOUCH_MOVE:
case TOP_TOUCH_CANCEL:
case TOP_SCROLL:
case TOP_WHEEL:
const elementListeners = getListenerTrackingFor(element);

if (!elementListeners.hasOwnProperty(dependency)) {
trapCapturedEvent(dependency, element);
trapBubbledEvent(dependency, element);
elementListeners[dependency] = true;
}
break;
Expand Down

0 comments on commit ec4c2e2

Please sign in to comment.