Giter Site home page Giter Site logo

Comments (8)

ryanthegiantlion avatar ryanthegiantlion commented on June 5, 2024 1

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.

from react-native-tinder-swipe-cards.

indivisable avatar indivisable commented on June 5, 2024 1

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

from react-native-tinder-swipe-cards.

yogiben avatar yogiben commented on June 5, 2024

Maybe you could put it in a modal or remove it from the scrollview somehow?

Maybe loop @brentvatne in

from react-native-tinder-swipe-cards.

ryanthegiantlion avatar ryanthegiantlion commented on June 5, 2024

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

from react-native-tinder-swipe-cards.

indivisable avatar indivisable commented on June 5, 2024

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.

from react-native-tinder-swipe-cards.

ryanthegiantlion avatar ryanthegiantlion commented on June 5, 2024

So I have seemed to have misplaced the code but I built a prototype using the method I mentioned above. Here is the outcome . . .

demo

from react-native-tinder-swipe-cards.

indivisable avatar indivisable commented on June 5, 2024

So you lock and unlock the ScrollView when the PanResponder in SwipeCard.js?

from react-native-tinder-swipe-cards.

ryanthegiantlion avatar ryanthegiantlion commented on June 5, 2024

Guess the issue can be closed then . . .

from react-native-tinder-swipe-cards.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.