Skip to content

Alternate method of jumping to the root of the render tree. #4558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
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