Open faceyspacey opened 8 years ago
Maybe you could put it in a modal or remove it from the scrollview somehow?
Maybe loop @brentvatne in
The scrollable tab view has a 'locked' property which can be set to prevent scrolling. Setting locked to true in the grant method should solve the issue.
EDIT: FYI the issue is described here. The article talks about scrollview which it seems is what the scrollable tab view uses internally
Ever figure this out? I am trying to put this inside a Vertical Scroll View and it does not seem to like, going to see if I can stop the touch events from propagating.
So I have seemed to have misplaced the code but I built a prototype using the method I mentioned above. Here is the outcome . . .
So you lock and unlock the ScrollView when the PanResponder in SwipeCard.js?
Actually I used https://github.com/Ryanthegiantlion/react-native-tinder-swipe but the code is similar. But yes, that is how I did it. In the panresponder I set a locked state on the component to true and passed that down as a prop to the scrollview.
Thanks Ryan,
Ended up passing down a callback to be called
onPanResponderGrant: (e, gestureState) => {
this.props.lock(false);
...
onPanResponderRelease: (e, {vx, vy, dx, dy}) => {
this.props.lock(true);
...
Here is the callback:
lock(mode) {
this.refs.scrollView.setNativeProps({ scrollEnabled: mode });
}
Also I Found an alternative solution, this works great I may move to this: (Ended up using this) https://github.com/mjracca/react-native-scroll-block
Guess the issue can be closed then . . .
I'm using reactive swipe cards as a page within: https://github.com/brentvatne/react-native-scrollable-tab-view
That also uses horizontal swiping gestures. I'd like the card to respond to the gesture while denying the containing scrolling component from responding to it. The scrolling component would respond to it you drag anywhere on the page besides the card.
So I'm assuming this has something to do with
grant
andrelease
gesture mechanisms. I don't suppose you or anyone have any hints how to implement this before I go on a wild goose chase?