[ListView] releases responder to parent
See original GitHub issueI have a ListView nested inside a View.
<View style={styles.container} {...this._panGesture.panHandlers}>
<ListView
ref="list"
dataSource={this.state.dataSource}
renderRow={this._renderRow}
style={styles.list}
/>
</View>
The outer View has a PanResponder. The ListView is not blocking the parent from taking the gesture responder but is releasing control to the parent View on move which causes the ListView to not be scrollable.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How to pass listview onClick events to parent view
I have a listview inside a RelativeLayout. I want any clicks on the listview to call the Relativelayout's onClick listener. How can the...
Read more >4. Components for Mobile - Learning React Native [Book]
Returning true allows release. View.props.onResponderTerminate. The responder has been taken from the view. It might be taken by other views after a call ......
Read more >[Solved]-Both the parent and the child components get rendered ...
Coding example for the question Both the parent and the child components get rendered simultaneously in react-native-React Native.
Read more >Platform Release Notes - PagerDuty Knowledge Base
This change truncates reminder email subject lines to 250 characters or less. This will affect on-call reminders, incident alerts, and add responder requests....
Read more >Major, candidate, and child cases
To identify major cases in the list view, check the value in the Major case ... case is created and the candidate case...
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
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jbuffin I ran into this issue today and found that if you overwrite a couple of the responders on the ListView’s ScrollResponder you can convince it to hold on to the gesture. I added a few lines to your
componentDidMount
function that will tell the ListView to capture all gestures by default and to deny any termination requests unless you’re scrolled to the top of the list. You can swap the logic inscrollResponderHandleTerminationRequest
to handle whatever case you need.EDIT: I swapped in
scrollResponderHandleStartShouldSetResponder
in place ofscrollResponderHandleStartShouldSetResponderCapture
so you don’t end up eating up all the touch events from child elements in the ListView.Hi there! This issue is being closed because it has been inactive for a while.
But don’t worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/listview-releases-responder-to-parent
ProductPains helps the community prioritize the most important issues thanks to its voting feature. It is easy to use - just login with GitHub. GitHub issues have voting too, nevertheless Product Pains has been very useful in highlighting the top bugs and feature requests: https://productpains.com/product/react-native?tab=top
Also, if this issue is a bug, please consider sending a pull request with a fix. We’re a small team and rely on the community for bug fixes of issues that don’t affect fb apps.