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

ScrollView not working when snapPoints enabled #389

Open
MaRaSu opened this issue Oct 11, 2024 · 0 comments
Open

ScrollView not working when snapPoints enabled #389

MaRaSu opened this issue Oct 11, 2024 · 0 comments

Comments

@MaRaSu
Copy link

MaRaSu commented Oct 11, 2024

I try to implement an ActionSheet that has a header (text) and a ScrollView. ActionSheet should support multiple SnapPoints and should have a max height (related to SnapPoints). If I skip the snapPoints and thus the ability to set ActionSheet at different heights on Screen I can get it working satisfactorily, but not with gestures & SnapPoints enabled. I'm using latest Expo 51 and currently focus on iOS, will need to do Android too.

The issues, in the order of priority:

  1. How to set the max height? I'm currently using the workaround from issue How to limit max expanded height? #322, as the way in docs (containerStyle) does not seem to work?
  2. ScrollView does not show all its content unless ActionSheet is snapped "high enough" on Screen. I expected ScrollView to always show (like with styling with flex:1) all scrollable content - I found a workaround by dynamically adding an empty View (with fixed height) on the bottom of the ScrollView based on onChange-events from ActionSheet, but that always resets ScrollView position when user is adjusting the height of ActionSheet so UX is not optimal.
  3. If I use, as recommended by the documentation, react-native-actions-sheet own ScrollView I get very restless behaviour where gestures on the ScrollView very easily also change the ActionSheet height, even when I have enableGesturesInScrollView set to false. I got better results by using RN normal ScrollView and have tested it both with and without NativeViewGestureHandler wrapping - slightly better actually without it.

Expo Snack example at https://snack.expo.dev/@marasu/actionsheet-with-scrollview

NB! Snack is not my "best" workaround implementation - rather is tries to be a faithful implementation of what documentation says should be a correct way of implementing ScrollView.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant