Skip to content
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

iOS modal screens disappear behind the previous screen #1356

Closed
2 of 7 tasks
enlightenedpie opened this issue Mar 6, 2022 · 6 comments
Closed
2 of 7 tasks

iOS modal screens disappear behind the previous screen #1356

enlightenedpie opened this issue Mar 6, 2022 · 6 comments
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided

Comments

@enlightenedpie
Copy link

enlightenedpie commented Mar 6, 2022

Description

I've attached a screen cap of what's happening, I'll try to explain it. No matter what modal "type" I try to use, whether formSheet, modal, contained, etc. etc., when dismissing the modal programmatically, the modal screen disappears behind the screen that's being navigated to or popped to in some cases. This even happens with a modal stacked on top of another modal. This does NOT happen with manual swipe gestures.

And to be clear, this is happening in using React Navigation. What I can't tell is if the unexpected behavior is from react-native-screens or @react-navigation/native-stack

Screenshots

RPReplay_Final1646077188.MP4

Steps To Reproduce

  1. I tried to repro this in a snack with the exact dependencies but could not. I'm happy to provide more evidence if necessary.
  2. There are no errors or warnings thrown when this behavior happens, so I can't provide a stack trace.

Expected behavior

When modal is dismissed, we should see the exit animation that reveals the screen underneath.

Actual behavior

The modal is dismissed but the screen "underneath" the modal seems to overtake the modal presentation in the view hierarchy, and the exit animation for the modal happens behind the previous or "underneath" screen.

Reproduction

I tried to repro this in a snack with the exact dependencies but could not. Included the Snack anyway just to be safe.
https://snack.expo.dev/tmN7fzMKF

Platform

  • iOS
  • Android
  • Web
  • Windows
  • tvOS

Workflow

  • Managed workflow
  • Bare workflow

Package versions

package version
react-native 0.65.0
@react-navigation/native 6.0.8
@react-navigation/native-stack 6.5.0
react-native-screens 3.13.1
react-native-safe-area-context 3.4.1
react-native-gesture-handler 2.3.0
react-native-reanimated 2.3.0-beta.3
@github-actions github-actions bot added Platform: iOS This issue is specific to iOS Missing info The user didn't precise the problem enough Repro provided A reproduction with a snack or repo is provided and removed Missing info The user didn't precise the problem enough labels Mar 6, 2022
@WoLewicki
Copy link
Member

I haven't been able to reproduce this behavior in the snack you provided so I am not sure if we can do anything about it unfortunately. Also I've never seen such issue, maybe there is something really weird in how you handle navigation actions and you need to extend your reproduction.

@shamilovtim
Copy link

Make sure you are not navigating from modal to modal since this does not seem to work correctly

@hirbod
Copy link
Contributor

hirbod commented Apr 30, 2022

Are you really sure you're not conditionally un-mounting the modal from the navigator? This is what it kinda looks like.

@enlightenedpie
Copy link
Author

I'm going to close this issue. I still don't know what was causing that undesired behavior, but it seems to have resolved itself after upgrading @react-navigation/native to 6.0.10 and @react-navigation/native-stack to 6.6.0.

@fahadfj
Copy link

fahadfj commented Jul 17, 2022

Still having this issue with the latest libraries, all back animations disappearing instantly, have tried multiple versions.

I'm really struggling to make a repro, the behaviour came on when I updated everything (and to react native 0.69), but I've since downgraded everything back and it's still there

  • Should add, if I enable headersShown: true, then I use the native back buttons on iOS I get all the correct expected animations.

@WoLewicki
Copy link
Member

@fahadfj I cannot say much without a minimal reproduction unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

No branches or pull requests

5 participants