PanResponder onPanResponderRelease doesn't calls on Android
See original GitHub issueI have this code in my render function.
<Animated.View
style={[styles.wrap, { left }]}
{...this.scrollResponder.panHandlers}
>
{initialRender &&
<View style={styles.wrap} {...this.listViewResponder.panHandlers}>
<ListView
ref={ref => this.listView = ref}
onScroll={this.handleScroll}
dataSource={posts}
renderRow={this.renderRow}
renderSectionHeader={this.renderHeader}
onEndReachedThreshold={300}
onEndReached={this.getPosts}
enableEmptySections={true}
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={this.onRefresh}
/>
}
/>
{!onProfile && this.renderSettings()}
</View>
}
{this.renderComments()}
{loading && !refreshing && <Loading />}
</Animated.View>
componentWillMount() {
this.listViewResponder = PanResponder.create({
onMoveShouldSetPanResponderCapture: this.setMove,
onPanResponderMove: this.handleMove,
onPanResponderRelease: this.handleMoveEnd,
onPanResponderTerminationRequest: () => false
});
this.scrollResponder = PanResponder.create({
onStartShouldSetPanResponderCapture: (e) => e.nativeEvent.pageY < THUMB_SIZE,
onPanResponderRelease: this.handlePress,
});
}
It’s works fine on iOS, But on Android onPanResponderRelease doesn’t calls every time.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:10
- Comments:11 (3 by maintainers)
Top Results From Across the Web
react native - onPanResponderRelease not being triggered
I got it working properly by using onPanResponderEnd instead of onPanResponderRelease . Also if we still want to use onPanResponderRelease ...
Read more >PanResponder — gestures not working - React native
In my case, I followed the official RN docs for pan-responder. It responded on iOS but not any android phone I tested on....
Read more >What are the main differences between ReactJS and React ...
Those React-Native components map the actual real native iOS or Android UI ... similar to the Javascript touch events web API called the...
Read more >[Solved]-Limit PanResponder movements React Native-React ...
How can I start a service so that it keeps running even after app closes/killed in an Android app using React-Native/hybrid? ... How...
Read more >8 Implementing cross-platform APIs - React Native in Action
Alert can be triggered by calling the alert method ( Alert.alert ). ... gets called if the PanResponder does not register // do...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am also having an issue with Android only. In my case, I am putting pan responder handlers on a
ListView
. It detects my gesture starting, but if the gesture also scrolls the list view, it seems to stop responding (stops callingonPanResponderMove
and also never callsonPanResponderTerminate
oronPanResponderRelease
). It works fine on iOS. For Android, it seems to only work on non-scrolling views.Hello, on Android,
onPanResponderTerminate
will be called rather thanonPanResponderRelease
, you can add following statement to make it work