Bottom sheet opens on rotation
Bug
The bottom sheet opens when it should be closed after rotation. Additionally, if the device is rotated with sheet open, the onChange is not called until the device is rotated back again. What is odd is this appears to only happen when snap points are [0%, 100%] (or very close to those numbers).
Environment info
| Library | Version |
|---|---|
| @gorhom/bottom-sheet | 2.3.0 |
| react-native | 0.63.2 |
| react-native-reanimated | 1.13.3 |
| react-native-gesture-handler | 1.10.3 |
Steps To Reproduce
- Open sheet
- Rotate device
- Close sheet
- Rotate device
Describe what you expected to happen:
- Sheet expected to remain closed
- Callback
onChangeto have been called when sheet was closed - Callback
onChangeto not be called with incorrect snapPoint after rotation.
Video of issue:
const snapPoints = useMemo(() => ["0%", '100%'], []);
https://user-images.githubusercontent.com/22333355/124296997-9599ee00-db28-11eb-898a-3a85736a42cb.mov
Video where only change is not using maxed snapPoints showing expected behavior.
const snapPoints = useMemo(() => ["20%", '100%'], []);
https://user-images.githubusercontent.com/22333355/124297138-bf531500-db28-11eb-80cd-0145172a8b49.mov
Reproducible sample code
Snack: https://snack.expo.io/@mookiies/github.com-mookiies-bottom-sheet-snap-point-demo (have to run on your device) Repo: https://github.com/Mookiies/bottom-sheet-snap-point-demo
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
bump
+1
+1
i will look into this 👍
I am still facing this issue on v4. Any solutions?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
bump
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue is active.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
bump
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
bump
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
bump
This issue still persists.
Are there any temporary patches for this until this issue is fix
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Bump
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
bump
This issue still exists .
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
bump
The issue still active
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
bump
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.