react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

<Drawer /> component cannot swipe on Android.

Open Bruce-zxy opened this issue 3 years ago • 2 comments

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

  • [x] 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

https://user-images.githubusercontent.com/22904758/163806980-06433fe5-9128-4d95-9c19-e6b6c370beaa.mp4

https://user-images.githubusercontent.com/22904758/163810749-2a443fa6-bcb8-4e1f-ae3a-ddcafaf8c708.mp4

Environment

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

Affected platforms

  • [x] Android
  • [ ] iOS
  • [ ] Web

Bruce-zxy avatar Apr 18 '22 12:04 Bruce-zxy

@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:

https://user-images.githubusercontent.com/33805983/165687994-92702989-d362-4813-bd93-e73daad2b0ce.mov

Inbal-Tish avatar Apr 28 '22 06:04 Inbal-Tish

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

blueridanus avatar Jul 20 '22 20:07 blueridanus