PanResponder blocks TouchableHighlight and TochableOpacity if they are inside of responding View.
No mere what this functions return true or false:
onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,
On GenyMotion Simulator all works great, set capture funtions to return false and we are good, but on nexus 6 and noname Android 4.4 device Touchables are not responding.
if we have
onStartShouldSetPanResponderCapture: (evt, gestureState) => false,
onMoveShouldSetPanResponderCapture: (evt, gestureState) => false,
inside touchables should respond to presses.
else
onStartShouldSetPanResponderCapture: (evt, gestureState) => true,
onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,
shouldn't.
It does not seem to work
this.typePanRep = PanResponder.create({
onStartShouldSetPanResponder: (evt, gestureState) => false,
onStartShouldSetPanResponderCapture: (evt, gestureState) => false,
onMoveShouldSetPanResponder: (evt, gestureState) => true,
onMoveShouldSetPanResponderCapture: (evt, gestureState) => false,
onPanResponderMove: (evt, gestureState) => {
},
})
<ListView
ref={listView => this._typelistView = listView}
dataSource={ds.cloneWithRowsAndSections(this.state.typeList)}
renderRow={this._renderTypeRowView.bind(this)}
{...this.typePanRep.panHandlers}
/>
PanResponder blocks the touches inside ListView in same models of android , and only sometimes.
i have the same problem :(
any ideas to fix it?
Replacing onPress with onPressIn at the TochableOpacity-Component solved the issue for me.
OnPressIn does the trick but in my case it triggers a swipe at the same time.
I have the same issue and I have asked the question on stackoverflow https://stackoverflow.com/questions/44653138/panresponder-could-not-detect-touch-if-i-touch-on-touchablestouchablehighlight
I have tried onPressIn but it does not work as expected. Sometimes it swipes while pressing
Any idea how to fix it?
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
Post a relevant snippet and I'll try to lend a hand @pie6k - just got around this issue myself by basically switching around the component order in render.
I just adjusted my "pan handle" component to be last in the stack, and within that I've placed a TouchableWithoutFeedback which receives onPress events (_on-top_ of the panResponder).
Most helpful comment
https://stackoverflow.com/questions/47568850/touchableopacity-with-parent-panresponder/50576784#50576784