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

[Bug]: Multiple BottomSheets conflict on iOS device (left reopens after right close)

Open daeuk1011 opened this issue 4 months ago • 8 comments

Version

v5

Reanimated Version

v3

Gesture Handler Version

v2

Platforms

iOS

What happened?

When using two bottom sheets with refs, after opening & closing the left sheet and then opening & closing the right sheet, the left sheet automatically reopens without any button press.

Reproduction steps

  1. Tap the left button → left bottom sheet opens.
  2. Close the left bottom sheet.
  3. Tap the right button → right bottom sheet opens.
  4. Close the right bottom sheet.
  5. Unexpected behavior: the left bottom sheet reopens automatically.
  • Note: This cannot be reproduced in Snack because it only occurs on a real iOS device, not on Simulator.

Reproduction sample

https://github.com/daeuk1011/gorhom-bottom-sheet-bug-repro

Relevant log output


daeuk1011 avatar Aug 22 '25 01:08 daeuk1011

https://github.com/user-attachments/assets/69f22f80-242a-46b5-9d3c-b446f6a68e9d

daeuk1011 avatar Aug 22 '25 01:08 daeuk1011

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 21 '25 09:09 github-actions[bot]

Had a similar issue to this, I resolved it with calling dissmiss on the ref to keep it closed.

In your BottomSheetBackdrop can you add an onPress where it calls ref.current.dismiss() or forceClose ? You'll have to figure out which one to close though.

apostols1 avatar Sep 22 '25 08:09 apostols1

Seems like this has something to do with stackBehavior='switch' which is the default` which restores the first sheet if you display the second one shortly after the dismiss. I also assumed that forceClose would solve it but it didn't work with modal bottom sheet, imo the sheet shouldn't be restored if it was dismissed regradless if the animation finished or no.

As a temporary fix, you can try stackBehavior='push'.

I have also noticed that you can quickly interrupt the forceClose animation with your finger to open the sheet again even though forceClose was called, which seems to be related to this.

RodSarhan avatar Sep 22 '25 12:09 RodSarhan

I have also noticed that closing the sheet quickly as it is still opening will cause the sheet to stay open instead of closing, feels like all those issues are related

RodSarhan avatar Oct 01 '25 12:10 RodSarhan

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 Nov 01 '25 09:11 github-actions[bot]

I'm also seeing this issue.

terreng avatar Nov 01 '25 18:11 terreng

I resolved this issue by adding stackBehavior="replace" to each Bottom Sheet Modal because, in my case, I use the modal a lot and use the useBottomSheetModal() hook to dismiss each modal with a unique name.

leotaozeng avatar Nov 20 '25 05:11 leotaozeng

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 Dec 20 '25 09:12 github-actions[bot]