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 Drawer Navigation is not working properly when drawerPosition: 'right' #10829

Closed
3 of 11 tasks
dhruvpvx opened this issue Sep 9, 2022 · 10 comments
Closed
3 of 11 tasks

Comments

@dhruvpvx
Copy link

dhruvpvx commented Sep 9, 2022

Current behavior

When drawer is positioned right side and if I open camera then if the camera is closed without capturing photo some part of the drawer remains unclosed and it can only be fixed after killing the app

uploaded image is from simulator but this isssue is causing mostly in real device when opening or closing the camera

Simulator.Screen.Recording.-.iPhone.13.-.2022-09-08.at.14.44.50.mp4

Simulator Screen Shot - iPhone 13 - 2022-09-08 at 14 44 36

Expected behavior

the drawer should close completely even if opening any type of feature

Reproduction

nolink

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

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

Environment

  • [] I've removed the packages that I don't use
package version
@react-navigation/native
@react-navigation/drawer
@react-navigation/stack
@react-navigation/native-stack
react-native-safe-area-context
react-native-screens
react-native-gesture-handler
react-native-reanimated
react-native
node
npm or yarn
@dhruvpvx dhruvpvx added the bug label Sep 9, 2022
@github-actions
Copy link

github-actions bot commented Sep 9, 2022

Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link, a www.typescriptlang.org/play link or link to a GitHub repo under your username).

Can you provide a minimal repro which demonstrates the issue? Please try to keep the repro as small as possible and make sure that we can run it without additional setup.

A repro will help us debug the issue. The issue will be closed automatically after a while if you don't provide a repro.

@github-actions
Copy link

github-actions bot commented Sep 9, 2022

Couldn't find version numbers for the following packages in the issue:

  • @react-navigation/native
  • @react-navigation/drawer
  • @react-navigation/stack

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

@joshbuchea
Copy link

We ran into this issue at my job recently. I'm not sure if this is the best solution, but we were ultimately only able to resolve by adding a marginLeft and adjusting the width in our drawer styles:

from { width: '80%' } to { marginLeft: '20%', width: '100%' }

<Drawer.Navigator
  screenOptions={{
    // ...
    drawerStyle: {
      // ...
      marginLeft: '20%',
      width: '100%',
    }
  }}>
  ...
</Drawer.Navigator>

Hopefully this info is helpful for your situation, good luck!

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

Hello 👋, this issue has been open for more than a month without a repro or any activity. If the issue is still present in the latest version, please provide a repro or leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution or workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix it.

@RenanDore
Copy link

this solution resolved to me:

Inside the navigator:

screenOptions={() => ({
        drawerStyle: {
          backgroundColor: 'white',
          width: '60%',
          color: '#f1f1f1',
          marginLeft: Platform.OS === 'ios' ? '10%' : '0%',
        },

Inside the drawerComponent at VStack:
w={Platform.OS === 'ios' ? '90%' : '100%'}

@github-actions
Copy link

Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro.

@github-actions
Copy link

Hey @dhruvpvx! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro.

The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.

You can provide a repro using any of the following:

A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected.

Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information.

You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro.

@usichenko-nikita
Copy link

As was mentioned here #10335 (comment) just add useLegacyImplementation prop to Drawer.Navigator

@MrSquaare
Copy link

useLegacyImplementation can't be used with Reanimated 3+ since legacy support has been removed

@minwoo129
Copy link

minwoo129 commented May 23, 2024

I had the same problem, but I think I found the way to solve it temporarily. (thanks to my colleague)

I think there is a problem in react-native-safe-area-context that drawer navigation library call.

we've edited by this (Check the drawerStyle block)

const dimensions = useSafeAreaFrame();

  return (
    <Drawer.Navigator
      initialRouteName="MainTabNavigator"
      screenOptions={{
        drawerType: 'front',
        drawerPosition: 'right',
        swipeEnabled: false,
        headerShown: false,
        drawerStyle: {
          backgroundColor: 'white',
          width: Dimensions.get('window').width * 0.95,
          marginLeft: Dimensions.get('window').width - dimensions.width,
        },
      }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants