[Bug]: `BottomSheetModal` does not open with `present()` after the modal was closed using two fingers.
Version
v5
Reanimated Version
v3
Gesture Handler Version
v2
Platforms
Android, iOS
What happened?
BottomSheetModal does not open with present after the modal was closed using two fingers.
In fact, there can be other, more complex situations, such as when a closing animation is triggered by a gesture, but the user might tap somewhere else on the screen at the same time.
Reproduction steps
-
When the modal is open, you need to place two fingers:
- Finger 1 on the Handle
- Finger 2 on the Content
-
Then, you need to swipe them down quickly enough. The swipe gesture should go all the way to the bottom of the screen.
The issue is intermittent, and there is a suspicion that it depends on the animation.
This can be reproduced in the example that is in the project repository. I left the link to the example empty because I couldn’t find a Snack for it.
https://github.com/user-attachments/assets/c699d4bb-b75f-4950-a73c-239e1ecfcc5b
Reproduction sample
https://snack.expo.dev/@sergeyrozhkov/blank
Relevant log output
LOG [handlePresent]
LOG [BottomSheetHandleContainer::handleBoundingClientRect] height:60
LOG [BottomSheetView::handleLayout] height:280
LOG [BottomSheetHandleContainer::handleContainerLayout] height:60
LOG [BottomSheet::useAnimatedReaction::OnSnapPointChange] result:588,392
LOG [BottomSheet::animateToPosition] currentPosition:872.7272727272727 nextPosition:588 source:1
LOG [BottomSheet::handleOnAnimate] toIndex:0 toPosition:588 fromIndex:-1 fromPosition:872.7272727272727
LOG [BottomSheet::animateToPositionCompleted] animatedCurrentIndex:-1 animatedNextPosition:588 animatedNextPositionIndex:0
LOG [useAnimatedReaction::OnChange] animatedCurrentIndex:-1 animatedIndex:0
LOG [BottomSheet::handleOnChange] index:0 animatedCurrentIndex:0
LOG [handleBottomSheetOnChange] minimized:false forcedDismissed:false
LOG index 0
LOG [BottomSheet::animateToPosition] currentPosition:691.2919502258301 nextPosition:784 source:2
LOG [BottomSheet::handleOnAnimate] toIndex:-1 toPosition:784 fromIndex:0 fromPosition:691.2919502258301
LOG [BottomSheet::animateToPositionCompleted] animatedCurrentIndex:0 animatedNextPosition:784 animatedNextPositionIndex:-1
LOG [handlePresent]
LOG [handlePresent]
LOG [handlePresent]
LOG [handlePresent]
Hello, I watching this problem too.
Having same issue. In fact it is the presented bottom sheet that is not getting dismissed, so trying to present it again does nothing. You can observe this by adding onDismiss={() => console.log('ActionsSheet dismissed')} there won't be a log if you place one finger anywhere else on the screen (backdrop) and slowly swipe down with another finger. Bottom sheet will be hidden, but not dismissed.
It looks like I'm facing the same problem. I'm a bit surprised this hasn't been fixed yet since it's very easy to reproduce (just tap rapidly to dismiss) and it completely breaks the re-opening functionality. Is there any workaround or planned fix for this?
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.
Still relevant.
I'm currently testing version 5.2.0, and it seems the issue no longer occurs. Could someone else verify this too?
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.