Skip to content

detachPreviousScreen is not set to false when using "presentation: 'modal'" option #12016

Closed
@IgorVanian

Description

@IgorVanian

Current behavior

Hi!

The docs say that detachPreviousScreen is set to false if presentation is set to transparentModal or modal.

It seems that it is not the case:

detachPreviousScreen = options.presentation === 'transparentModal'
? false

In my app, it's true by default on iOS and the previous screen is visible but on Android the previous screen is not visible.

Is it a mistake in the docs or in the code? Should I make a PR with detachPreviousScreen = options.presentation === 'transparentModal' || options.presentation === 'modal' ?

Expected behavior

If the docs are correct, detachPreviousScreen should be set to false when using presentation: 'modal'

Reproduction

None.

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack
  • react-native-tab-view

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/native 6.1.6
@react-navigation/bottom-tabs 6.3.1
@react-navigation/stack 6.3.16
react-native-screens 3.29.0
react-native-gesture-handler 2.15.0
react-native-reanimated 3.7.1
react-native-tab-view 3.1.1
react-native-pager-view 5.4.11
react-native 0.73.6
node 18.16.1
npm or yarn 1.22.17

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions