From 5c6e59f53cd95dc00fd73908d89b5afe083fa90b Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 10 Jul 2013 14:44:32 -0700 Subject: [PATCH] Don't ignore children of non-ancestor ID nodes in findComponentRoot. --- src/core/ReactInstanceHandles.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/ReactInstanceHandles.js b/src/core/ReactInstanceHandles.js index a4ddec7592..c077c88108 100644 --- a/src/core/ReactInstanceHandles.js +++ b/src/core/ReactInstanceHandles.js @@ -302,6 +302,11 @@ var ReactInstanceHandles = { firstChildren.length = childIndex = 0; firstChildren.push(child.firstChild); break; + } else { + // TODO This should not be necessary if the ID hierarchy is + // correct, but is occasionally necessary if the DOM has been + // modified in unexpected ways. + firstChildren.push(child.firstChild); } } else { // If this child had no ID, then there's a chance that it was