feat(iOS, FormSheet v5): Emit onDismiss event when dismissed from JS#4124
Open
t0maboro wants to merge 1 commit into
Open
feat(iOS, FormSheet v5): Emit onDismiss event when dismissed from JS#4124t0maboro wants to merge 1 commit into
t0maboro wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new onDismiss callback to the experimental FormSheet API to notify JS when the sheet has been dismissed programmatically (by toggling isOpen to false). This helps consumers distinguish JS-driven dismissal from user-driven native gesture dismissal (onNativeDismiss).
Changes:
- Extended the Fabric/codegen spec and public TypeScript types to include
onDismiss. - Implemented iOS native emission of
onDismisswhen the sheet is dismissed via the presentation manager. - Added a dedicated iOS single-feature-test scenario to validate
onDismissvsonNativeDismiss.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/fabric/gamma/modals/form-sheet/FormSheetHostNativeComponent.ts | Adds onDismiss to the codegen native component event props. |
| src/components/gamma/modals/form-sheet/FormSheet.types.ts | Exposes onDismiss in the public FormSheetProps API with docs. |
| ios/gamma/modals/form-sheet/RNSFormSheetPresentationManager.mm | Triggers a delegate callback after programmatic dismissal completes. |
| ios/gamma/modals/form-sheet/RNSFormSheetHostEventEmitter.mm | Implements native emission for the new onDismiss event. |
| ios/gamma/modals/form-sheet/RNSFormSheetHostEventEmitter.h | Declares the new emitOnDismiss method. |
| ios/gamma/modals/form-sheet/RNSFormSheetHostComponentView.mm | Implements sheetControllerDidDismiss and forwards to the event emitter. |
| ios/gamma/modals/form-sheet/RNSFormSheetContentController.h | Extends the delegate protocol with sheetControllerDidDismiss. |
| apps/src/tests/single-feature-tests/form-sheet/test-form-sheet-dismiss-events-ios/scenario.md | Adds a manual test scenario covering both dismiss event types. |
| apps/src/tests/single-feature-tests/form-sheet/test-form-sheet-dismiss-events-ios/scenario-description.ts | Registers metadata for the new SFT scenario. |
| apps/src/tests/single-feature-tests/form-sheet/test-form-sheet-dismiss-events-ios/index.tsx | Implements the test screen UI and logging for dismiss events. |
| apps/src/tests/single-feature-tests/form-sheet/index.ts | Adds the new dismiss-events scenario to the FormSheet scenario group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LKuchno
approved these changes
Jun 3, 2026
LKuchno
left a comment
Collaborator
There was a problem hiding this comment.
Good idea to put an event logs area on the screen! :)
253054a to
2ec6bdd
Compare
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.
Description
Adding
onDismissevent, which will be fired when the sheet is dismissed programmatically from JS via togglingisOpenprop tofalse.Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1268
Changes
Before & after - visual documentation
ios25.mov
Test plan
Added dedicated SFT
Checklist