Skip to content

fix(ios): present a modal opened while the sheet is dismissing - #1019

Merged
lodev09 merged 3 commits into
lodev09:mainfrom
JacquesLeupin:fix/ios-modal-while-sheet-dismissing
Nov 16, 2026
Merged

lodev09 merged 3 commits into
lodev09:mainfrom
JacquesLeupin:fix/ios-modal-while-sheet-dismissing

Conversation

@JacquesLeupin

Copy link
Copy Markdown
Contributor

Summary

Fixes #1018.

With the react-native-screens patch, navigating to a modal while a sheet is dismissing left the stack unable to present any modal until the app restarted.

newPresentingViewController returned the sheet even while it was being dismissed. react-native-screens made it the presenter, saw beingDismissed, and returned without releasing its update lock. It now returns nil in that case, so the stack presents from its own controller, and UIKit queues that presentation until the dismissal ends.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

Repro app from #1018 on an iPhone 17 Pro simulator (iOS 27.0), with RN 0.88.1 and react-native-screens 4.30.1 plus the patch. Tested as 4.1.0 with this change applied; main has the same iOS sources as 4.1.0.

4.1.0 this PR
dismiss() then navigate('Modal') Modal never opens Modal opens once the sheet is gone
Open a modal afterwards Nothing opens Opens

Navigating to a modal from a sheet that stays open still presents it over the sheet.

Not tested: a drag-to-dismiss that gets cancelled after the modal was requested.

Screenshots / Videos

4.1.0 this PR
The sheet closes and no modal opens The sheet closes and the modal opens

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)
  • I added a changelog entry (if needed)

newPresentingViewController returned the sheet even while it was being
dismissed. With the react-native-screens patch from the navigation
guide, the stack took it as the presenter, bailed out because it was
being dismissed, and never released its modal update lock, so no modal
could open until the app restarted.
@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

@JacquesLeupin is attempting to deploy a commit to the lodev09 Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-true-sheet Ready Ready Preview Nov 16, 2026 6:17pm UTC

Request Review

@lodev09
lodev09 merged commit 54b99f5 into lodev09:main Nov 16, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — 256f99d5 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] Modals stop opening after navigating to one while the sheet dismisses

2 participants