You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On iOS with Fabric, setting a Modal's visible prop to false while the modal's native view controller is presenting another view controller does not dismiss the modal itself.
The presented view controller disappears and React Native emits onDismiss, but the modal's page sheet remains onscreen without its React content. The resulting empty sheet cannot be dismissed.
This occurs in a real app when an async action closes a composer while iOS's Undo Typing alert is visible. It also reproduces in a Debug build when the modal is presenting React Native's developer menu, suggesting the issue applies to any presented view controller rather than the specific alert.
Expected behavior: dismissing the React Native Modal should dismiss the modal and any view controllers it presents, revealing the screen underneath.
The likely cause is that Fabric's RCTModalHostViewComponentView calls dismissViewControllerAnimated:completion: on the modal view controller itself. When that controller is presenting an alert or menu, UIKit dismisses only the presented child and runs the completion. React Native consequently emits onDismiss and removes the React content even though the modal remains presented.
Install dependencies and launch the Release build with yarn ios --mode Release.
Tap Open modal.
Type anything in the text input.
Tap Close modal in 5 seconds.
Immediately shake the device and leave the Undo Typing alert open. In Simulator, choose Device → Shake or press Control-Command-Z.
Wait for the timeout to set the Modal's visible prop to false.
Observe that the alert disappears and onDismiss fires, but an empty page sheet remains stuck onscreen.
A normal yarn ios Debug build also reproduces the issue; shake opens React Native's developer menu instead of Undo Typing, but the same stuck sheet remains after the timeout.
Description
On iOS with Fabric, setting a
Modal'svisibleprop tofalsewhile the modal's native view controller is presenting another view controller does not dismiss the modal itself.The presented view controller disappears and React Native emits
onDismiss, but the modal's page sheet remains onscreen without its React content. The resulting empty sheet cannot be dismissed.This occurs in a real app when an async action closes a composer while iOS's Undo Typing alert is visible. It also reproduces in a Debug build when the modal is presenting React Native's developer menu, suggesting the issue applies to any presented view controller rather than the specific alert.
Expected behavior: dismissing the React Native
Modalshould dismiss the modal and any view controllers it presents, revealing the screen underneath.The likely cause is that Fabric's
RCTModalHostViewComponentViewcallsdismissViewControllerAnimated:completion:on the modal view controller itself. When that controller is presenting an alert or menu, UIKit dismisses only the presented child and runs the completion. React Native consequently emitsonDismissand removes the React content even though the modal remains presented.Originally observed in bluesky-social/social-app#11393.
Steps to reproduce
Using the minimal reproducer:
yarn ios --mode Release.visibleprop tofalse.onDismissfires, but an empty page sheet remains stuck onscreen.A normal
yarn iosDebug build also reproduces the issue; shake opens React Native's developer menu instead of Undo Typing, but the same stuck sheet remains after the timeout.React Native Version
0.87.1
Affected Platforms
Areas
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://github.com/mozzius/modal-alert-dismiss-repro
Screenshots and Videos
Screen.Recording.2026-09-04.at.14.25.33-compressed.mp4