fix: bottom sheet modals fail to reopen after being dismissed - #6039
Merged
Conversation
Since the bottom-sheet 5.2.6 to 5.2.14 bump in the Expo 56 upgrade, modal sheets (e.g. the personal invite sheet) could only be opened once. Two separate issues: - gorhom 5.2.7+ replaced the modal's boolean refs with a MODAL_STATUS state machine in which dismiss() on an already-dismissed modal (status INITIAL) falls through, permanently corrupts the status to DISMISSING, and makes every later present() a silent no-op. BottomSheetWrapper calls dismiss() whenever open flips false, which always happens after a user-initiated close has already dismissed the modal internally. Extend our existing pnpm patch with the upstream-proposed fix (gorhom/react-native-bottom-sheet#2669): treat INITIAL as already closed in handleDismiss. - gorhom never emits onChange(-1) when a sheet is dismissed before its open animation completes, so handleSheetChanges couldn't sync parent state and open stayed stuck at true, turning later opens into no-ops. Wire the modal's onDismiss callback to sync parent state whenever it still believes the sheet is open.
janicduplessis
marked this pull request as ready for review
July 1, 2026 23:08
dnbrwstr
approved these changes
Jul 2, 2026
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since the Expo 56 upgrade bumped
@gorhom/bottom-sheetfrom 5.2.6 to 5.2.14, modal bottom sheets — everything rendered throughActionSheet/BottomSheetWrapperwithmodal, e.g. the personal invite sheet on the Home header — can only be opened once per mount. Closing the sheet and tapping the trigger again silently does nothing until the screen remounts.Changes
Two independent problems, both in the modal path of
BottomSheetWrapper:Extend the existing
@gorhom/bottom-sheetpnpm patch with the fix proposed in gorhom/react-native-bottom-sheet#2669 (no fixed release exists yet; 5.2.14 is latest — fix submitted upstream as gorhom/react-native-bottom-sheet#2711). 5.2.7's newMODAL_STATUSstate machine gets permanently stuck inDISMISSINGwhendismiss()is called on an already-dismissed modal, so every laterpresent()silently bails. Our wrapper always callsdismiss()after a user-initiated close (backdrop tap / swipe down), so the first close corrupted the modal. The patch treatsINITIALas already-closed inhandleDismiss, making it idempotent.Sync parent state from the modal's
onDismiss. Gorhom never emitsonChange(-1)when a sheet is dismissed before its open animation finishes, soopenstayed stuck attrueand later opens became state no-ops (setOpen(true)with state alreadytrue→ effect never re-runs → nopresent()).onDismissfires on every dismissal path; the handler only callsonOpenChange(false)when the parent still believes the sheet is open, so programmatic closes behave as before. Worst case is an extraonOpenChange(false)after a close, which consumers already receive fromonChange(-1)today.How did I test?
iOS simulator, dev build, on the personal invite sheet (Home header → AddPerson):
Risks and impact
The lib patch only widens
handleDismiss's already-closed early-exit; non-modal sheets are untouched.Rollback plan
Revert the commit — it restores the previous patch file, lockfile patch hash, and wrapper behavior.
Screenshots / videos
Before (sheet opens once, second tap dead):
repro-before-trimmed.mp4
After (repeated open/close cycles):
fixed-demo.mp4