wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.53k stars 712 forks source link

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

Closed Bruce-zxy closed 22 hours ago

Bruce-zxy commented 2 years ago

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

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

Affected platforms

Inbal-Tish commented 2 years ago

@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

blueridanus commented 2 years ago

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

ethanshar commented 22 hours ago

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