Skip to content

[Bug]: BottomSheetModal does not open after dismissAll 5.2.8 #2632

@rozhkovs

Description

@rozhkovs

Version

v5

Reanimated Version

v3

Gesture Handler Version

v2

Platforms

iOS

What happened?

If we open several modals using BottomSheetModal and then call dismissAll(), the first modal may stop opening. This reproduces fairly consistently if done quickly, especially on iOS.

Reproduction steps

  1. Run the example from the repository.
  2. Click the "Stack Modals" button.
  3. Press "Present Modal A"
  4. Press "Present Modal B"
  5. Press "Dismiss All Modals"
  6. Press "Present Modal A" again

You need to do it quickly enough for it to reproduce consistently.

For our application, this was critical; the temporary workaround was to switch to stackBehavior={'replace'}.

Simulator.Screen.Recording.-.iPhone.17.-.2026-03-13.at.16.15.32.mov

Reproduction sample

https://snack.expo.dev/@sergeyrozhkov/blank

Relevant log output

LOG  [handlePresent] 
 LOG  [BottomSheetHandleContainer::handleBoundingClientRect] height:60
 LOG  [BottomSheetHandleContainer::handleContainerLayout] height:60
 LOG  [BottomSheet::useAnimatedReaction::OnSnapPointChange] result:568.5,379
 LOG  [BottomSheet::animateToPosition] currentPosition:874 nextPosition:568.5 source:1
 LOG  [BottomSheet::handleOnAnimate] toIndex:0 toPosition:568.5 fromIndex:-1 fromPosition:874
 LOG  [BottomSheet::useAnimatedReaction::OnSnapPointChange] result:568.5,379
 LOG  [BottomSheet::animateToPosition] currentPosition:874 nextPosition:568.5 source:1
 LOG  [handleMinimize] minimized:false
 LOG  [BottomSheet::handleClose] 
 LOG  [handlePresent] 
 LOG  [BottomSheet::animateToPosition] currentPosition:569.1839184857414 nextPosition:758 source:3
 LOG  [BottomSheet::handleOnAnimate] toIndex:-1 toPosition:758 fromIndex:-1 fromPosition:569.1839184857414
 LOG  [BottomSheetHandleContainer::handleBoundingClientRect] height:60
 LOG  [BottomSheetHandleContainer::handleContainerLayout] height:60
 LOG  [BottomSheet::useAnimatedReaction::OnSnapPointChange] result:568.5,379
 LOG  [BottomSheet::animateToPosition] currentPosition:874 nextPosition:568.5 source:1
 LOG  [BottomSheet::handleOnAnimate] toIndex:0 toPosition:568.5 fromIndex:-1 fromPosition:874
 LOG  [BottomSheet::useAnimatedReaction::OnSnapPointChange] result:568.5,379
 LOG  [BottomSheet::animateToPosition] currentPosition:874 nextPosition:568.5 source:1
 LOG  [handleDismiss] currentIndexRef:-1 minimized:true
 LOG  [BottomSheet::handleForceClose] 
 LOG  [handleDismiss] currentIndexRef:-1 minimized:false
 LOG  [handleRestore] minimized:true forcedDismissed:true
 LOG  [BottomSheet::handleForceClose] 
 LOG  [BottomSheet::animateToPosition] currentPosition:568.5843406709115 nextPosition:758 source:3
 LOG  [BottomSheet::handleOnAnimate] toIndex:-1 toPosition:758 fromIndex:-1 fromPosition:568.5843406709115
 LOG  [BottomSheet::animateToPositionCompleted] currentIndex:-1 nextIndex:-1 nextPosition:758
 LOG  [BottomSheet::handleOnClose] 
 LOG  [handleBottomSheetOnClose] minimized:true forcedDismissed:true
 LOG  [BottomSheet::animateToPositionCompleted] currentIndex:-1 nextIndex:-1 nextPosition:758
 LOG  [BottomSheet::handleOnClose] 
 LOG  [handleBottomSheetOnClose] minimized:false forcedDismissed:true
 LOG  [unmount] 
 LOG  [resetVariables] 
 LOG  [handlePortalOnUnmount] minimized:false forcedDismissed:false
 LOG  [handlePresent] 
 LOG  [handlePresent] 
 LOG  [handlePresent] 
 LOG  [handlePresent]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions