Skip to content

feat(iOS): add an option to prevent dismissal of external modals #2994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Ubax
Copy link
Contributor

@Ubax Ubax commented Jul 8, 2025

Description

In some cases, dismissing a modal not owned by RNScreens may not be the expected behavior.

Changes

Added a new protocol, RNSDismissibleModalProtocol, which can be used by external libraries to control whether their modal should be dismissed when pushing a screen’s modal on top.

When dismissing the top modal, the code now checks for conformance to this protocol. If the modal implements the protocol and isDismissible is true, the dismiss will not happen.

In all other cases, the behavior of setModalViewControllers remains the same as before this change.

Test code and steps to reproduce

Checklist

@Ubax Ubax changed the title feat(iOS): add feat(iOS): add an option to prevent dismissal of external modals Jul 8, 2025
@Ubax Ubax force-pushed the @ubax/prevent-modal-dismissal branch from 62804f5 to d2717b2 Compare July 31, 2025 11:59
@Ubax Ubax marked this pull request as ready for review July 31, 2025 12:04
@Ubax Ubax force-pushed the @ubax/prevent-modal-dismissal branch from 713ea0c to c929057 Compare July 31, 2025 12:12
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.

1 participant