react-native-bottom-sheet icon indicating copy to clipboard operation
react-native-bottom-sheet copied to clipboard

[Bug]: `BottomSheetModal` does not open with `present()` after the modal was closed using two fingers.

Open rozhkovs opened this issue 6 months ago • 1 comments

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

  1. When the modal is open, you need to place two fingers:

    • Finger 1 on the Handle
    • Finger 2 on the Content
  2. 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]

rozhkovs avatar Jun 10 '25 07:06 rozhkovs

Hello, I watching this problem too.

Zhironkin avatar Jun 19 '25 07:06 Zhironkin

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.

Shaninnik avatar Jun 24 '25 19:06 Shaninnik

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?

SSmolyakov avatar Jun 26 '25 11:06 SSmolyakov

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.

github-actions[bot] avatar Jul 27 '25 09:07 github-actions[bot]

Still relevant.

jerone avatar Jul 27 '25 13:07 jerone

I'm currently testing version 5.2.0, and it seems the issue no longer occurs. Could someone else verify this too?

rozhkovs avatar Aug 18 '25 09:08 rozhkovs

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.

github-actions[bot] avatar Sep 17 '25 09:09 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Sep 22 '25 09:09 github-actions[bot]