Check alternate in ReactTreeTraversal (#8992)
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.
Ben Alpert committed
Feb 13, 2017 at 14:24 UTC
1e722e4a97dc03632d0f88ae47b2581ca9619736
1 file changed
+2
-2
src/renderers/shared/shared/ReactTreeTraversal.js
+2
-2
@@ -62,7 +62,7 @@ function getLowestCommonAncestor(instA, instB) {
62
// Walk in lockstep until we find a match.
63
var depth = depthA;
64
while (depth--) {
65
- if (instA === instB) {
65
+ if (instA === instB || instA === instB.alternate) {
66
return instA;
67
}
68
instA = getParent(instA);
@@ -76,7 +76,7 @@ function getLowestCommonAncestor(instA, instB) {
76
*/
77
function isAncestor(instA, instB) {
78
while (instB) {
79
- if (instB === instA) {
79
+ if (instA === instB || instA === instB.alternate) {
80
return true;
81
}
82
instB = getParent(instB);