react-native-steve icon indicating copy to clipboard operation
react-native-steve copied to clipboard

How to make it work for RTL?

Open mehulgecg opened this issue 3 years ago • 15 comments

Really very good component, I've used this component in one of my apps but don't know how to make it work for RTL? any reference and help would be highly appreciated. Thank you so much.

mehulgecg avatar Apr 06 '21 09:04 mehulgecg

Hi. I'll have a look for what we can do to add rtl support

tsdmrfth avatar Apr 06 '21 10:04 tsdmrfth

@tsdmrfth thanks for your consideration.

mehulgecg avatar Apr 06 '21 10:04 mehulgecg

Fixed in https://github.com/tsdmrfth/react-native-steve/pull/14

tsdmrfth avatar Apr 10 '21 22:04 tsdmrfth

@mehulgecg New version released now. Let me know if that works now

tsdmrfth avatar Apr 11 '21 11:04 tsdmrfth

This feature available now

tsdmrfth avatar Apr 14 '21 08:04 tsdmrfth

@tsdmrfth Great work with RTL but unfortunately it doesn't work as expected.

  1. In RTL, all things should be reversed and starting from right side. In your component list starts from left side even when I set isRTL to true.
  2. When we swipe from left to right, whole list goes out of screen.
  3. In RTL mode, list item is showed in new line if there is not enough space available in the screen, which is not what this component is made for right? It should show horizontal scrolling.

rajc-hkis avatar Apr 14 '21 12:04 rajc-hkis

Hi @rajc-hkis. Which version of react-native-steve component are you using?

tsdmrfth avatar Apr 14 '21 13:04 tsdmrfth

@tsdmrfth I am on latest 0.4.1

rajc-hkis avatar Apr 14 '21 13:04 rajc-hkis

This is from current version. Seems work correctly. What is the wrong about that?

https://user-images.githubusercontent.com/27639087/114720022-51c0f500-9d40-11eb-962c-e7f45a57a947.mov

tsdmrfth avatar Apr 14 '21 13:04 tsdmrfth

@tsdmrfth Looks like it works for you which is good sign.

I use forceRTL(true) in my app, you think that can cause issue? Since you use row-reverse when isRTL is set to true, I think that could be it. I attached video, so you can have better idea of the issue I am facing. :)

https://user-images.githubusercontent.com/75483781/114976388-84373300-9ea3-11eb-858c-b0c8d0e8af9e.mov

rajc-hkis avatar Apr 16 '21 05:04 rajc-hkis

Hi @rajc-hkis can you also provide some code about you issue?

tsdmrfth avatar Apr 16 '21 08:04 tsdmrfth

@tsdmrfth Code is same as provided in README file of this repo. There is only one difference and that is I use I18nManager.forceRTL(true); to make my whole app in RTL layout.

rajc-hkis avatar Apr 16 '21 10:04 rajc-hkis

I think that is the reason for the issue. forceRTL function call makes row reversed twice. RTL layout check should be done in component instead of expecting prop.

tsdmrfth avatar Apr 16 '21 10:04 tsdmrfth

@tsdmrfth Yes, agreed.

You can check whether app is RTL or not by I18nManager.isRTL property. Plus, I think you should keep the prop there in case someone wants to have RTL layout without forceRTL. What do you think? ;)

rajc-hkis avatar Apr 16 '21 10:04 rajc-hkis

@rajc-hkis That makes sense 👊🏿

tsdmrfth avatar Apr 16 '21 11:04 tsdmrfth