Skip to content

fix(iOS): Prevent delay when dismissing transparentModals#3189

Merged
kmichalikk merged 3 commits intomainfrom
@kmichalikk/animation-duration-transparent-modal-3074
Sep 9, 2025
Merged

fix(iOS): Prevent delay when dismissing transparentModals#3189
kmichalikk merged 3 commits intomainfrom
@kmichalikk/animation-duration-transparent-modal-3074

Conversation

@kmichalikk
Copy link
Contributor

Description

Closes #3074.

This PR removes the delay when dismissing fullscreen modal-like screens. This behavior can be observed on native apps, but makes things look as if they are broken. We also observe that modal screens don't take transitionDuration into account. We don't plan on supporting it now, but might look into it in the future. Docs are updated to reflect the current state.

Testing

Use Test3074. It has 4 screens in stack - 1. and 2. are a regular screen, 3. & 4. are transparentModals. The last one should dismiss immediately without animation. Revert changes in RNSScreen to see the bug. Checking Debug/Slow animations in simulator makes it even more apparent.

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed that despite not scheduling animation callback we still receive "progress notification" when animation: 'none' is set:
image

Could you give me some context of how is this achieved? I do not get it instantly from reading the diff.

@kkafar
Copy link
Member

kkafar commented Sep 8, 2025

Okay, I've found, that we emit 0.0 & 1.0 transition progress in viewWillAppear & viewDidAppear. That's fine then. We do not have to do anything more here.

@kkafar kkafar mentioned this pull request Sep 8, 2025
8 tasks
@kkafar
Copy link
Member

kkafar commented Sep 8, 2025

I've opened diff against this PR. #3205. If you want, land it or apply these manually / start discussion about these changes.

kmichalikk and others added 3 commits September 9, 2025 09:34
@kmichalikk kmichalikk force-pushed the @kmichalikk/animation-duration-transparent-modal-3074 branch from 434c86e to 2cf2d6a Compare September 9, 2025 07:47
@kmichalikk kmichalikk merged commit afe1ad8 into main Sep 9, 2025
6 checks passed
@kmichalikk kmichalikk deleted the @kmichalikk/animation-duration-transparent-modal-3074 branch September 9, 2025 08:16
satya164 added a commit to react-navigation/react-navigation that referenced this pull request Oct 30, 2025
Docs update to match changes in react-native-screens
software-mansion/react-native-screens#3189.

**Motivation**

In RN Screens, we fixed the bug with delay when dismissing full screen
modals, and updated the docs for `transitionDuration` to reflect that we
don't support customizing it for modals. This PR adds matching change to
`animationDuration` doc.

---------

Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
satya164 added a commit to react-navigation/react-navigation that referenced this pull request Oct 30, 2025
Docs update to match changes in react-native-screens
software-mansion/react-native-screens#3189.

**Motivation**

In RN Screens, we fixed the bug with delay when dismissing full screen
modals, and updated the docs for `transitionDuration` to reflect that we
don't support customizing it for modals. This PR adds matching change to
`animationDuration` doc.

---------

Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
satya164 added a commit to react-navigation/react-navigation that referenced this pull request Nov 1, 2025
Docs update to match changes in react-native-screens
software-mansion/react-native-screens#3189.

**Motivation**

In RN Screens, we fixed the bug with delay when dismissing full screen
modals, and updated the docs for `transitionDuration` to reflect that we
don't support customizing it for modals. This PR adds matching change to
`animationDuration` doc.

---------

Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
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.

[createNativeStackNavigator] animationDuration not work in transparentmodal and it's slow on closing

3 participants