From 981b6a2b7608342d805143525851718972a95b31 Mon Sep 17 00:00:00 2001 From: maxaggedon Date: Fri, 18 Dec 2020 12:33:57 +0100 Subject: [PATCH] Pass panHandlers to row component This allows developers to set the pan handlers on a specific view inside the item. I especially needed this because my items are full width and the scroll view on android kept stealing the touch events. --- src/Row.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Row.js b/src/Row.js index 32718a8..14cc92c 100644 --- a/src/Row.js +++ b/src/Row.js @@ -59,7 +59,7 @@ export default class Row extends Component { // Returns whether this component should block native components from becoming the JS // responder. Returns true by default. Is currently only supported on android. // NOTE: Returning false here allows us to scroll unless it's a long press on a row. - return false; + return true; }, onPanResponderGrant: (e, gestureState) => { @@ -172,14 +172,13 @@ export default class Row extends Component { return ( - {this.props.manuallyActivateRows && children - ? cloneElement(children, { - toggleRowActive: this._toggleActive, + {children && + cloneElement(children, { + toggleRowActive: this.props.manuallyActivateRows ? this._toggleActive: undefined, + panHandlers: this._panResponder.panHandlers }) - : children } );