From 047e50751f1f36e499246f1c385b6960cf0d412a Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Mon, 13 Feb 2017 14:20:10 -0800 Subject: [PATCH] Check alternate in ReactTreeTraversal 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. --- src/renderers/shared/shared/ReactTreeTraversal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderers/shared/shared/ReactTreeTraversal.js b/src/renderers/shared/shared/ReactTreeTraversal.js index 6cf041100215..07969dc4a68d 100644 --- a/src/renderers/shared/shared/ReactTreeTraversal.js +++ b/src/renderers/shared/shared/ReactTreeTraversal.js @@ -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); @@ -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);