React-native-gesture-handler: DrawerLayout different Behavior when drawerPosition is set to Right

Created on 14 Feb 2019  路  10Comments  路  Source: software-mansion/react-native-gesture-handler

Current Behavior (also the BUG is presented in react-navigation)

In DrawerLayout component when drawerPosition property is set to Right the Drawer behavior is wrong due to:

  • The drawer is shown when user swipe from right to left in the middle of the screen instead of same gesture from the border.
  • After drawer is opened and closed completely and user swipe from left border to right, the drawer shows a flash in the right side of the screen.

Expected Behavior

The drawer behavior must be same as when the drawerPosition property is set to Left:

  • Show the drawer just when user swipes from the border.
  • Drawer flash not will be shown when user swipes from the contrary border.

How to reproduce

  • Execute the demo project
  • Go to "Gesture handler based DrawerLayout"
  • Try to swipe in the middle of the screen from the right to left, you will see the first issue.
  • After that close the drawer and try to swipe from the left border, you will see the drawer flash.

Demo Project:
https://drive.google.com/open?id=1DT086RShAASE4_lx3kzGbWfr9hTPl9uV

Your Environment

| software | version
| ---------------- | -------
| react-native-gesture-handler | 1.0.15
| react-native | 0.58.4
| compileSdkVersion | 28
| supportLibVersion | 28.0.0

Most helpful comment

I just updated to react-native-gesture-handler: "1.2.1" and it solved the buggy drawer behavior.

All 10 comments

I have the same issue...do you solve it?

Hi @adawi9, I had fixed it by momentarily updating the file:
node_modules \ react-navigation-drawer \ dist \ views \ DrawerView.js.
you must replace the DrawerLayout component with DrawerLayoutAndroid.
I tested it only on Android and it's working.

Can you share the updated file with me to replace it on my project

Yes, the mentioned file is:
DrawerView.zip

The file must be located in the following path:
Your project\node_modules\react-navigation-drawer\dist\views\DrawerView.js

Yeah it is working now...thanks dear...I think the team of react-native-gesture-handler and react-navigation must fix it...I attached a file to handle android and iOS
DrawerView.js.zip

Yes, I have the same problem. The edgeWidth prop is ignored when the sidebar is set to Right.

any update on this using react-navigation v3?

I just updated to react-native-gesture-handler: "1.2.1" and it solved the buggy drawer behavior.

Can confirm that >1.2.1 fixed it for me. I'm currently on 1.3.0 and it's working perfectly. This could probably be closed.

I will close it as @Aidurber suggests, if that's still an issue please comment to reopen

Was this page helpful?
0 / 5 - 0 ratings