Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

RTL is not supported! #184

Closed
moerabaya opened this issue Mar 27, 2017 · 35 comments · Fixed by #808
Closed

RTL is not supported! #184

moerabaya opened this issue Mar 27, 2017 · 35 comments · Fixed by #808

Comments

@moerabaya
Copy link

What i'm suffering from is that the tabs still functioning the same as the LTR after switching to RTL, I know what seems to be the issue because I have a custom indicator, but i'm not able to use negative values to translate them to the opposite.

Thank you so much.

untitled

@satya164
Copy link
Owner

Can you send a PR to fix this?

@yaronlevi
Copy link

This bug also affects react-navigation. The TabNavigator is not working:

react-navigation/react-navigation#860

@yaronlevi
Copy link

yaronlevi commented Mar 30, 2017

Inside TabViewPagerScroll.js putting flexDirection: 'row-reverse' on the <ScrollView /> fixes the problem partially. The tab's contents is shown but the order is reverse.

@dastoori dastoori mentioned this issue Apr 8, 2017
@dastoori
Copy link

dastoori commented Apr 8, 2017

@yaronlevi, look at my last comment here: facebook/react-native#11960 (comment)

@moerabaya, I sent a PR #194, until it merged, you can use one of these:

  • npm i -S https://github.com/dastoori/react-native-tab-view.git#rtl-support
  • npm i -S https://github.com/dastoori/react-navigation.git#rtl-support

@satya164
Copy link
Owner

Re-opening this since RTL is not yet supported in TabViewPagerScroll, hence unsupported on iOS.

@satya164 satya164 reopened this Apr 20, 2017
@dastoori
Copy link

@satya164, iOS ScrollView has been fixed in ReactNative v0.43.2 (facebook/react-native#11960 (comment))

@satya164
Copy link
Owner

Nice. I think we may still need to handle the scroll position etc.

@dastoori
Copy link

dastoori commented Apr 20, 2017

I tested this in v0.0.59, I used the examples from examples folder. These examples doesn't work properly:

  • "1. Scrollbar top bar"

scrollabletopbar

  • "3. Bottom bar with indicator"

bottombarwithindicator

Other examples are works fine:

scrollviews

@satya164
Copy link
Owner

  1. Bottom bar with indicator

This one uses a custom indicator, that's why. Should be easy to fix.

"1. Scrollbar top bar"

Yeah, this one will be more involved

@0xori
Copy link

0xori commented Mar 7, 2018

Any updates on this one?

@satya164
Copy link
Owner

If you need this, pull requests are welcome.

@noambonnie
Copy link

@satya164 - I created a pull request to add support for RTL. I hope it can be accepted and merged.

Thank you.

@noambonnie
Copy link

Adding a link to the PR - not sure if 2 months is a reasonable time or not. I'm sure the team is busy...

#556

@horodnicdragos
Copy link
Contributor

Hey there @noambonnie. I've taken a look at your fix and I've tested it on both iOS and android. While this fixes the issue on android, it breaks iOS so I've just added a platform specific condition. Take a look at my fork:

https://github.com/horodnicdragos/react-native-tab-view

Not sure if this is the best approach on the long term but having this merged would be amazing. Do you want to update your PR or should I do one?

@noambonnie
Copy link

@horodnicdragos what's broken on iOS? Does your code (ignoring iOS for those calculation) work fine on iOS RTL?

If broken on iOS we'll need to fix it there too. If your fix works on both platforms in RTL (and LTR...) then fine

@horodnicdragos
Copy link
Contributor

horodnicdragos commented Sep 4, 2018

Yes, for some reason the calculations are not required on iOS. I'll make the PR and hope for the best.

#602

@noambonnie
Copy link

@horodnicdragos please note that your PR failed the linter requirements. Follow the test procedures at the bottom of the project page (under "Contributing"). Otherwise it won't even be considered.

@ghost
Copy link

ghost commented Sep 6, 2018

@satya164 can you check #602 and merge it?

@noambonnie
Copy link

I hope it gets merged soon...

@0xori
Copy link

0xori commented Oct 2, 2018

is it going to be merged soon?

@satya164
Copy link
Owner

satya164 commented Oct 2, 2018

it is already merged and released. but the PR is Android only.

@horodnicdragos
Copy link
Contributor

horodnicdragos commented Oct 3, 2018

@0xori It is working just fine on iOS for me. Did you encounter any RTL issues? By the way, I've only fixed the issue on the scrollbar top bar which I was using. Didn't get the change to look at the bottom one.

@MahmoudAliIbrahim
Copy link

still having the same issue on android , for ios it is fixed using this #675

@FadiAboMsalam
Copy link

any updates on this ?

@satya164
Copy link
Owner

@FadiAboMsalam It's marked as "help wanted". PR welcome.

satya164 added a commit that referenced this issue Jun 18, 2019
satya164 added a commit that referenced this issue Jun 18, 2019
satya164 added a commit that referenced this issue Jun 18, 2019
satya164 added a commit that referenced this issue Jun 18, 2019
satya164 added a commit that referenced this issue Jun 18, 2019
satya164 added a commit that referenced this issue Jun 18, 2019
satya164 added a commit that referenced this issue Jun 18, 2019
satya164 added a commit that referenced this issue Jun 21, 2019
osdnk pushed a commit that referenced this issue Jun 21, 2019
ankeetmaini pushed a commit to ankeetmaini/react-native-tab-view that referenced this issue Jul 7, 2019
@Abdo-zayed
Copy link

in TabBar.js
modify this function
_this.resetScroll = function (value) {
const tabLength=this.props.navigationState.routes.length-1;

    const target=I18nManager.isRTL?tabLength-value:value;
    console.log(tabLength+' '+target)
    if (_this.props.scrollEnabled) {
        _this.scrollView && _this.scrollView.scrollTo({
            x: _this.getScrollAmount(_this.props, _this.state,target),
            animated: true
        });
    }
};

@hosseinmd
Copy link

this issue doesn't fix, please don't close

@satya164
Copy link
Owner

@hosseinmd please open a new issue with a runnable repro as mentioned in the issue template.

@hosseinmd
Copy link

I resolve this, that is my fault

@matifriaz
Copy link

I am having the same issue on IOS. Did anyone manage to solve it?

@YogiHa
Copy link

YogiHa commented Dec 18, 2021

+1

1 similar comment
@saravanakumargn
Copy link

+1

@syedamirali14
Copy link

syedamirali14 commented Jun 8, 2022

this issue is still happening on iOS

@syedamirali14
Copy link

i have fixed this issue on iOS will make a new PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.