mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix touch inspector when using Nodes
Summary: Fix touch inspector when using Nodes by implementing custom logic. This logic now takes into account that non-View nodes need to be clickable. Reviewed By: astreet Differential Revision: D3433927
This commit is contained in:
@@ -59,4 +59,22 @@ import android.text.Spanned;
|
||||
|
||||
return super.getReactTag(touchX, touchY);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean matchesTag(int tag) {
|
||||
if (super.matchesTag(tag)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mLayout != null) {
|
||||
Spanned text = (Spanned) mLayout.getText();
|
||||
RCTRawText[] spans = text.getSpans(0, text.length(), RCTRawText.class);
|
||||
for (RCTRawText span : spans) {
|
||||
if (span.getReactTag() == tag) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user