React-native-reanimated-bottom-sheet: When a touchable component (inside renderHeader) is pressed, snapTo() method doesn't work on Android.

Created on 23 Mar 2019  路  4Comments  路  Source: osdnk/react-native-reanimated-bottom-sheet

I was trying to perform snapTo to hide bottomsheet when header is tapped. I wasn't able to do so Android. However, it works on iOS.

It can be reproduced in this snack. (Took one of the snack from earlier issues)
Long press the "Profile" tab to show the bottom sheet.
https://snack.expo.io/@roshangm1/bottom-sheet

I would like to dig in more on this (doing it too). If you have any clue on what could be the possible reason for this behavior, please do let me know.

Most helpful comment

This issue has been fixed after the merge of https://github.com/james-macindoe/react-native-gesture-handler/commit/bae1632334cd53ed720380c8ddecdfc89b70dce0 in react-native-gesture-handler. However, when using enabledInnerScrolling={false}, this issue exist. I will close this issue and create new issue for this.

All 4 comments

I took a look into this and seem to have found the cause. The problem is that after pressing on a Touchable in the header, panMasterState transitions to State.FAILED, but snaps only run if it's State.END.

This is a work around which avoids the problem https://github.com/james-macindoe/react-native-gesture-handler/commit/bae1632334cd53ed720380c8ddecdfc89b70dce0

I don't know much about gesture handlers so I'm not sure if this is the correct fix or just a hack. Any suggestions @osdnk?

This issue has been fixed after the merge of https://github.com/james-macindoe/react-native-gesture-handler/commit/bae1632334cd53ed720380c8ddecdfc89b70dce0 in react-native-gesture-handler. However, when using enabledInnerScrolling={false}, this issue exist. I will close this issue and create new issue for this.

@roshangm1 snapTo doesn't work with enabledInnerScrolling={false} as you stated. Where did you open the issue? This is a big problem :(

Still experiencing this problem with React native paper button

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sebqq picture sebqq  路  4Comments

lukebars picture lukebars  路  5Comments

Arjun-aks picture Arjun-aks  路  4Comments

davidgovea picture davidgovea  路  4Comments

praneeth-hiver picture praneeth-hiver  路  4Comments