Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions src/renderers/dom/client/ReactEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,13 @@ PooledClass.addPoolingTo(
);

function handleTopLevelImpl(bookKeeping) {
// TODO: Re-enable event.path handling
//
// if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
// // New browsers have a path attribute on native events
// handleTopLevelWithPath(bookKeeping);
// } else {
// // Legacy browsers don't have a path attribute on native events
// handleTopLevelWithoutPath(bookKeeping);
// }

void handleTopLevelWithPath; // temporarily unused
handleTopLevelWithoutPath(bookKeeping);
if (bookKeeping.nativeEvent.path && bookKeeping.nativeEvent.path.length > 1) {
// New browsers have a path attribute on native events
handleTopLevelWithPath(bookKeeping);
} else {
// Legacy browsers don't have a path attribute on native events
handleTopLevelWithoutPath(bookKeeping);
}
}

// Legacy browsers don't have a path attribute on native events
Expand Down Expand Up @@ -133,10 +128,9 @@ function handleTopLevelWithPath(bookKeeping) {
);

// Jump to the root of this React render tree
while (currentPathElementID !== newRootID) {
var container = ReactMount.findReactContainerForID(newRootID);
while (i + 1 < path.length && path[i + 1] !== container) {
i++;
currentPathElement = path[i];
currentPathElementID = ReactMount.getID(currentPathElement);
}
}
}
Expand Down