Skip to content

Commit

Permalink
Check alternate in ReactTreeTraversal (facebook#8992)
Browse files Browse the repository at this point in the history
Test Plan: Couldn't figure out how to write a unit test. :\ Verified that enter/leave bubbling now works correctly in one FB interface that was broken though.
  • Loading branch information
sophiebits authored Feb 13, 2017
1 parent 6367f9f commit 1e722e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/renderers/shared/shared/ReactTreeTraversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function getLowestCommonAncestor(instA, instB) {
// Walk in lockstep until we find a match.
var depth = depthA;
while (depth--) {
if (instA === instB) {
if (instA === instB || instA === instB.alternate) {
return instA;
}
instA = getParent(instA);
Expand All @@ -76,7 +76,7 @@ function getLowestCommonAncestor(instA, instB) {
*/
function isAncestor(instA, instB) {
while (instB) {
if (instB === instA) {
if (instA === instB || instA === instB.alternate) {
return true;
}
instB = getParent(instB);
Expand Down

0 comments on commit 1e722e4

Please sign in to comment.