8000 [Android] Broken `DrawerItem.onPress` in `DrawerContentScrollView` · Issue #12561 · react-navigation/react-navigation · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Android] Broken DrawerItem.onPress in DrawerContentScrollView #12561

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
4 of 13 tasks
alex-fournier opened this issue Apr 22, 2025 · 8 comments
Open
4 of 13 tasks

[Android] Broken DrawerItem.onPress in DrawerContentScrollView #12561

alex-fournier opened this issue Apr 22, 2025 · 8 comments

Comments

@alex-fournier
Copy link
alex-fournier commented Apr 22, 2025

Current behavior

In a Drawer navigator with a long list of items, onPress is not called as soon as we scroll in the ScrollView. This only occurs when app is builded using New Architecture ("newArchEnabled": true).

Expected behavior

onPress should be called when pressing a drawer item.

Reproduction

https://snack.expo.dev/WxCPCzLOBpRtsqMB2Xp3U

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-drawer-layout
  • react-native-tab-view

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/native 7.1.6
@react-navigation/drawer 7.3.9
react-native-drawer-layout 4.1.6
react-native-screens 4.4.0
react-native-safe-area-context 4.12.0
react-native-gesture-handler 2.20.2
react-native-reanimated 3.16.7
react-native 0.77.1
expo 52.0.46
node 22.11.0
npm or yarn 1.22.22
Copy link
8000

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • @react-navigation/native (found: 7.3.9, latest: 7.1.6)
  • @react-navigation/drawer (found: 7.1.6, latest: 7.3.9)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

@alex-fournier
Copy link
Author

I edited the versions (was inverted...).

The issue seems located in react-native-drawer-layout.

Copy link

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

  • react-native-drawer-layout

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

@mingca
Copy link
mingca commented May 13, 2025

@alex-fournier were you able to resolve this issue? I have the same problem.

@alex-fournier
Copy link
Author

@alex-fournier were you able to resolve this issue? I have the same problem.

No... I have disabled the New Architecture on Android for now...

@wkedzierawski
Copy link

@mingca you can try to wrap your CustomDrawerContent in ScrollView. It worked for me.

DrawerContentScrollView -> ScrollView -> CustomDrawerContent (your custom components and `DrawerItemList`)
<DrawerContentScrollView scrollEnabled={false} nestedScrollEnabled>

@mingca
Copy link
mingca commented May 13, 2025

@mingca you can try to wrap your CustomDrawerContent in ScrollView. It worked for me.

DrawerContentScrollView -> ScrollView -> CustomDrawerContent (your custom components and `DrawerItemList`)
<DrawerContentScrollView scrollEnabled={false} nestedScrollEnabled>

Thanks for your reply. I tried the exact same approach but it did work for me. @wkedzierawski

@mingca
Copy link
mingca commented May 13, 2025

Well it worked, I just had to set the height.

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

3 participants
0