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

<Drawer /> component cannot swipe on Android. #1994

Closed
2 of 7 tasks
Bruce-zxy opened this issue Apr 18, 2022 · 3 comments
Closed
2 of 7 tasks

<Drawer /> component cannot swipe on Android. #1994

Bruce-zxy opened this issue Apr 18, 2022 · 3 comments
Assignees
Labels
bug a bug in one of the components waiting-for-response

Comments

@Bruce-zxy
Copy link

Bruce-zxy commented Apr 18, 2022

Description

I ran the program on two real devices, iPod touch 6 (iOS 12.5.5) and Redmi Note 8 Pro (Android 11), through the minimal code shown below, and found that the swipe operation cannot be responded to on the Android device.

However, although the sliding operation cannot be responded to on Android, it can still be controlled by methods such as openRight/openLeft and closeDrawer.

Related to

  • Components
  • Demo
  • Docs
  • Typings

Steps to reproduce

There are no reproduction steps, you can directly see.

Expected behavior

Hope to be responsive swipe on Android.

Actual behavior

Unresponsive swipe action on Android.

More Info

Code snippet

<Drawer
  ref={ref}
  disableHaptic
  useNativeAnimations
  rightItems={[
    {
      text: "Read",
      background: '#00000FF',
      onPress: () => console.log("read pressed"),
    },
  ]}
  leftItem={{
    text: "Delete",
    background: '#E5E5E5',
    onPress: () => console.log("delete pressed"),
  }}
>
  <View style={{ height: 60, backgroundColor: "pink" }}>
    <Text>Item</Text>
  </View>
</Drawer>

Screenshots/Video

Screenrecorder-2022-04-18-20-08-14-469.mp4
VID_20220418_201432.mp4

Environment

  • React Native: 0.64.3
  • React Native UI Lib: 6.12.0

Affected platforms

  • Android
  • iOS
  • Web
@Bruce-zxy Bruce-zxy added the bug a bug in one of the components label Apr 18, 2022
@Inbal-Tish Inbal-Tish self-assigned this Apr 27, 2022
@Inbal-Tish
Copy link
Collaborator

@Bruce-zxy Did you try it on other Android devices or emulators? I coundn't reproduce on my emulator (Android 11 Pixel_3a_API_30). See my video:

Drawer.Android.right.swipe.issue.1994.mov

@blueridanus
Copy link

I was having the same issue, but wrapping the app root with <GestureHandlerRootView> solved this, as per RNGH's docs.

@ethanshar
Copy link
Collaborator

This issue was fixed
The Drawer component now internally wraps with GestureHandlerRootView

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in one of the components waiting-for-response
Projects
None yet
Development

No branches or pull requests

4 participants