fix inspecting text elements

Differential Revision: D2663651

fb-gh-sync-id: 2b583fecf5fa7a88f071a7441d03b95d21b8620f
This commit is contained in:
Felix Oghină 2015-11-17 07:54:37 -08:00 committed by facebook-github-bot-3
parent fc511f0730
commit 8491b579c8
2 changed files with 18 additions and 4 deletions

View File

@ -835,4 +835,17 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
mOperationsQueue.enqueueSendAccessibilityEvent(tag, eventType);
}
/**
* Get the first non-virtual (i.e. native) parent view tag of the react view with the passed tag.
* If the passed tag represents a non-virtual view, the same tag is returned. If the passed tag
* doesn't map to a react view, or a non-virtual parent cannot be found, -1 is returned.
*/
/* package */ int getNonVirtualParent(int reactTag) {
ReactShadowNode node = mShadowNodeRegistry.getNode(reactTag);
while (node != null && node.isVirtual()) {
node = node.getParent();
}
return node == null ? -1 : node.getReactTag();
}
}

View File

@ -383,10 +383,11 @@ public class UIViewOperationQueue {
final float containerX = (float) mMeasureBuffer[0];
final float containerY = (float) mMeasureBuffer[1];
final int touchTargetReactTag = mNativeViewHierarchyManager.findTargetTagForTouch(
mReactTag,
mTargetX,
mTargetY);
final int touchTargetReactTag = mUIManagerModule.getNonVirtualParent(
mNativeViewHierarchyManager.findTargetTagForTouch(
mReactTag,
mTargetX,
mTargetY));
try {
mNativeViewHierarchyManager.measure(