Skip to content

Scrollview prevent swiping up the PanGestureHandler #1150

@NiccoloCase

Description

@NiccoloCase

In my app I have a screen where inside there is a PanGestureHandler which as a child has an Animated.View (reanimated) inside which there is a ScrollView.

PanGestureHandler -> Animated.View -> ScrollView

At the moment the user is able to freely move the screen with the touch. This occurs through transformations applied to the Animated.View.
However, I cannot use the scrollView.

What I would like to achieve is that as long as the scrollView is at the top (so the scroll offset is 0) the user is able to move the card freely on the screen, but as soon as he scrolls down this thing can no be longer done.

I got very close to what I want to do; but the problem is that even when the scrollView is totally at the beginning (and therefore there is nothing at the top to swipe) if I swipe from top to bottom this (the swipe) is not caught from the PanGestureHandler (as it happens if I swipe horizontally) but it is managed by the ScrollView which, however, will do nothing.

So what I ask is if there is a property or a workaround to get that if the user swipes from the bottom up, this will be managed by the scollView, but if he swipes all the other directions, this will be managed by the PanGestureHandler .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Gesture handlersThis issue is related to problems with gesture handlers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions