Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PanResponder with Scrollview doesn't generate onRelease event in Android #25226

Closed
kishorekondepudi opened this issue Jun 11, 2019 · 5 comments
Closed
Labels
API: PanResponder Bug Component: ScrollView Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@kishorekondepudi
Copy link

I am trying to implement an apple maps style draggable drawer for my application. UI has two views one on background and the foreground view is in the drawer at the bottom of the screen by default. We should be able to drag it a bit to top and release it to have it slide over to the top automatically.

Once the view is at the top we should be able to scroll with in the drag view and then when the scroll reaches the top position and scrolling beyond top is continued the view should come down and collapse to the bottom much like Apple Maps.

In case of iOS it works absolutely fine, I have one responder on the container and another responder on the scroll view. Once the container is at top the outer responder doest respond.Once the content is scrolled to top the inner responder will trigger the slide down animation after a threshold movement of say 10 in dy. This is handled from pan responders onPanResponderRelease event while the movement dy is handled in onPanResponderMove

How ever in case of Android this responder doesn't work. It never generates onPanResponderRelease and hence I had to hack it and put the animation into the move event itself.

React Native version:

Steps To Reproduce

https://snack.expo.io/@kishore.kondepudi/nested-responder

  1. Goto the snack above, The yellow area is the drawer which has the parent pan responder. Drag it a few points above and release to see it sliding over to top. Once the top is reached the parent responder will not capture events and control is given to scroll view. The scrollview is also registered with a pan responder which responds only when the scroll position is reached to the top.
  2. In iOS once you reach the scroll top the pan responder will activate and if you continue scrolling few more points and release the draw comes down.

How ever this panResponderRelease never fires in android. Instead in order to workaround the animation had to be put into the move event itself.

Describe what you expected to happen:

The inner responder should fire onResponderRelease event after the top is reached. So that the required action can be done.

Snack, code example, or link to a repository:

https://snack.expo.io/@kishore.kondepudi/nested-responder

@kishorekondepudi kishorekondepudi changed the title Nested PanResponder with Scrollview doesn't generate onRelease event in Android PanResponder with Scrollview doesn't generate onRelease event in Android Jun 11, 2019
@dungnguyen10989
Copy link

The same issue with me, did you find any solution to resolve it ?

@mrkacan
Copy link

mrkacan commented Nov 15, 2019

same issue.

@lake2
Copy link

lake2 commented Nov 20, 2019

same issue + 1

@stale
Copy link

stale bot commented Feb 18, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 18, 2020
@stale
Copy link

stale bot commented Feb 27, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Feb 27, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Feb 28, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: PanResponder Bug Component: ScrollView Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants