Search code examples
javascriptandroidreactjstouchreact-native

Android React native touch responder debugging - determine touch responder


Is there good way to debug which component is the touch responder for a given touch?

Technically anything wrapped inside a < Touchable* > should respond to touch and call onPress. (No problem with same thing in IOS) But onPress is not getting called.

My pressable text lies in a listview item, where listview is a page of scrollable tabview (Thanks to Mr. Brent Vatne) https://github.com/brentvatne/react-native-scrollable-tab-view

Also I checked that native view doesn't steal touch(e.g Scrollview etc.) by logging interceptTouchEvent in ReactRootView, nor does scrollable tab view steal the touch,

Nor does the scrollable tabview steal the touch, logged inside onStart onMove* onEnd* methods of ScrollableTabView.

The component hierarcy is not very trivial so I am unable to code up a simple example ,

Any suggestions for debugging touch are welcome..


Solution

  • Just check this issue on scrollable-tab-view. Basically you need to use a ViewPagerAndroid instead of default Animated.View with panResponder. Check this for rough implementation.