Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL apps with a horizontal scrollView #11960

Closed
hamidhadi opened this issue Jan 18, 2017 · 10 comments
Closed

RTL apps with a horizontal scrollView #11960

hamidhadi opened this issue Jan 18, 2017 · 10 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@hamidhadi
Copy link

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?

@hamidhadi hamidhadi changed the title RTL apps with a horizontal scrollbar RTL apps with a horizontal scrollView Jan 19, 2017
@dastoori
Copy link

dastoori commented Jan 23, 2017

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

@dastoori
Copy link

dastoori commented Feb 6, 2017

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
leecade/react-native-swiper#314
ptomasroos/react-native-scrollable-tab-view#508

@dastoori
Copy link

dastoori commented Feb 10, 2017

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

@dastoori
Copy link

dastoori commented Apr 8, 2017

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

@TGNC
Copy link

TGNC commented Apr 18, 2017

This is a deal breaker, someone is on it?

@hramos
Copy link
Contributor

hramos commented Jul 20, 2017

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.

@malashkevich
Copy link

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

@DanGDroid
Copy link

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

@dastoori
Copy link

dastoori commented Dec 6, 2017

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

@hramos
Copy link
Contributor

hramos commented Dec 21, 2017

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.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants