react-native-drawer-layout icon indicating copy to clipboard operation
react-native-drawer-layout copied to clipboard

Does not work correctly in right to left (RTL) mode

Open yuvalrakavy opened this issue 7 years ago • 10 comments

When used with right to left language (RTL), such as Hebrew or Arabic, the drawer is displayed incorrectly.

To force RTL mode, add the following to your index.*.js import {I18nManager} from 'react-native';

I18nManager.forceRTL(true)

yuvalrakavy avatar Apr 03 '17 20:04 yuvalrakavy

Can you specify "incorrectly" a bit? You can set the drawer open mode to the other side, but I guess that isn't what you want to do, right?

DanielMSchmidt avatar Apr 03 '17 21:04 DanielMSchmidt

I fixed the problem, I would like to create a pull request and push the fix. However for some reason I have no permissions

yuvalrakavy avatar Apr 03 '17 22:04 yuvalrakavy

Hi!

I added a pull request with my fix. When in RTL mode, the X coordinates are swapped (0 is on the right side). So most of the things just work (although it is a bad habit to call things right or left, since in RTL mode, these names are really confusing since right is on the left and left is on the right).

Yuval

On Tue, 4 Apr 2017 at 00:30 Daniel Schmidt [email protected] wrote:

Can you specify "incorrectly" a bit? You can set the drawer open mode to the other side, but I guess that isn't what you want to do, right?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-drawer-layout/issues/29#issuecomment-291280126, or mute the thread https://github.com/notifications/unsubscribe-auth/ACyQFCMjRsgYnWI0WAxi1U9JMcHtuDKvks5rsWT_gaJpZM4MyFCR .

yuvalrakavy avatar Apr 03 '17 23:04 yuvalrakavy

Thank you for the PR, I will give it a try 👍

DanielMSchmidt avatar Apr 28 '17 19:04 DanielMSchmidt

Using react-navigation which is using this package, The drawer is in the middle of the screen instead of in hiding on initial state. On DrawerOpen it is in the correct state, but on close this is how it looks like. @DanielMSchmidt

annelorraineuy avatar May 05 '17 18:05 annelorraineuy

@annelorraineuy, The react-navigation uses the old version of ‍react-native-drawer-layout (v1.2.0), your problem was fixed in this PR (v1.3.0).

You can use my react-navigation fork for a while until the RTL issue will be resolved: npm install -S git+https://github.com/dastoori/react-navigation.git#3616d9e

dastoori avatar May 07 '17 14:05 dastoori

@dastoori thanks! you're right. it is fixed now

annelorraineuy avatar May 24 '17 20:05 annelorraineuy

In 1.3.2 it now works for me in iOS, but the behaviour on Android seems more broken than in earlier versions ...

On RTL Android with v1.1.0, the first time you opened the drawer it would open from the wrong side of the screen but would move all the way across the screen and end up in the correct open position, then when you closed it it would slide away correctly. After that initial funny, the drawer would work as expected regardless of system directionality.

However, on RTL Android with 1.3.2, the drawer is now partially visible on the screen when "closed" and ignores the drawerPosition prop (drawer is always at the left side of the screen on RTL android).

steveliles avatar Nov 10 '17 09:11 steveliles

@steveliles Might be that you would want to switch to react-native-drawer-layout-polyfill we use the native drawer there for android.

I would also love to accept a PR for that, but I currently don't have the time to put more love into this 😞

DanielMSchmidt avatar Nov 10 '17 09:11 DanielMSchmidt

@DanielMSchmidt thanks for the tip - I wasn't aware of drawer-layout-polyfill

We appreciate the time you already put in :) ... will submit a PR if I can find some time.

[edit] - drawer-layout-polyfill has solved the problem for me, thx!

steveliles avatar Nov 10 '17 10:11 steveliles