React-native: RTL apps with a horizontal scrollView

Created on 18 Jan 2017  路  10Comments  路  Source: facebook/react-native

In the info.plist, I changed the Localization native development region to 'fa' so my app direction is RTL.
ScrollView horizontal does not work fine.
I can't see the scroll indicator and can't scrolling.
If I change the Localization native development region to LTR languages, the scrollview works fine.
Is there anyway to solve this problem?

Locked

Most helpful comment

Hey, this is still a problem, guys. :(
Can we reopen this issue?

All 10 comments

Same here, Horizontal ScrollView doesn't work properly in RTL Layout (on both iOS and Android)

Reproduction

Use RTLExample page in UIExplorer to apply RTL layout and then use horizontal ScrollView in <ScrollView> page

Additional Information

  • React Native version: 0.40.0
  • Platform: iOS, Android
  • Operating System: MacOS

Anyone can help/contribute?

It's a bug and it breaks my app and a lot of good components like react-native-swiper and react-native-scrollable-tab-view that uses horizontal ScrollView.

Example:

This is my code:

<ScrollView horizontal>
  <View style={{ width: 150, height: 100, backgroundColor: '#12a19e' }}><Text>1</Text></View>
  <View style={{ width: 150, height: 100, backgroundColor: '#f45b21' }}><Text>2</Text></View>
  <View style={{ width: 150, height: 100, backgroundColor: '#640fe7' }}><Text>3</Text></View>
  <View style={{ width: 150, height: 100, backgroundColor: '#8f5e3e' }}><Text>4</Text></View>
  <View style={{ width: 150, height: 100, backgroundColor: '#f4bd15' }}><Text>5</Text></View>
  <View style={{ width: 150, height: 100, backgroundColor: '#137cf9' }}><Text>6</Text></View>
</ScrollView>

Preview:

React Native version: 0.41.1

iOS normal layout:
ios-ltr

iOS RTL layout:
ios-rtl

Android normal layout:
android-ltr

Android RTL layout
android-rtl mov

Related issues:

13100

10852

https://productpains.com/post/react-native/rtl-scrollview
https://github.com/leecade/react-native-swiper/issues/314
https://github.com/skv-headless/react-native-scrollable-tab-view/issues/508

Temporary fix:

<ScrollView
  horizontal
  style={{ flexDirection: I18nManager.isRTL ? 'row-reverse' : 'row' }}
>
   ...
</ScrollView>

In RTL layout you should use scrollToEnd() method to scroll to the first item

I tested this again on v0.43.2 and the iOS ScrollView works as expected, but the Android ScrollView still has this issue

This is a deal breaker, someone is on it?

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

Hey, this is still a problem, guys. :(
Can we reopen this issue?

tried updating rn up to 49 still horizontal flatlist on rtl does not function

It seems that it's fixed on v0.51.0 (this commit)
Can anyone test this version on Android?

I won't be reopening this issue as it does not contain sufficient information as required by the template. You may聽open a new one.

Was this page helpful?
0 / 5 - 0 ratings