react-multi-carousel icon indicating copy to clipboard operation
react-multi-carousel copied to clipboard

No RTL support

Open dquak opened this issue 4 years ago • 14 comments

Describe the bug There is no option to set the swipe to be from right to left (RTL) To Reproduce

Expected behavior Adding prop for a RTL support (isRTL={true})

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

dquak avatar Aug 21 '19 18:08 dquak

Hi,

Do you mean swipe right moves the Carousel to the right? What's the use case for this?

YIZHUANG avatar Aug 21 '19 18:08 YIZHUANG

https://spotifylabscom.files.wordpress.com/2019/04/image7.gif Hi, This is an example of the direction. You understood it correctly, but to elaborate more- when you begin swiping, right arrow becomes the previous item indicator and is disabled, and left arrow means next item when sliding. When reaching the last item, left is disabled. To ease it, please think of the behavior expected by rtl language users (Hebrew, Arabic).

dquak avatar Aug 21 '19 18:08 dquak

Hi, @YIZHUANG any updates about this feature request?

dquak avatar Aug 26 '19 16:08 dquak

Hi, i am a bit busy lately, i will need some time, but meanwhile any PRs would be appreciated

YIZHUANG avatar Aug 28 '19 14:08 YIZHUANG

I need this feature too

Dastnbek avatar Dec 23 '19 10:12 Dastnbek

@dquak is there any alternatives ?

Dastnbek avatar Dec 23 '19 10:12 Dastnbek

@YIZHUANG i made a quick fix locally, adding a isRTL prop which then on previous() and next() functions, changed this: setState({transform: this.props.isRTL ? -nextPosition : nextPosition}) -> it fixes RTL when using customButtonGroup only. Is there any chance this RTL feature would get priority ?

Thanks!

saharalon avatar Dec 25 '19 22:12 saharalon

I see working on this feature requires some efforts, as the behaviour for keep tracking of the current slide needs to be changed as well and of course the infinite mode included. I just don't have that time for such a big task for now, if anyone's up for it, feel free to work on it.

YIZHUANG avatar Jan 16 '20 16:01 YIZHUANG

Any update on this feature? or suggestions

iqasim-com avatar Dec 14 '20 18:12 iqasim-com

I'm new to GitHub. I have made a change for RTL language support on my local clone. But I'm not sure how to open a PR. Contributing docs aren't helpful and I seem to not have access (can't push a branch). @YIZHUANG how do I open a PR?

mctrafik avatar Jun 11 '21 00:06 mctrafik

really need direction support any updates on this @YIZHUANG ?

MAfzalKhan1997 avatar Jul 30 '21 07:07 MAfzalKhan1997

Hi, I seem to found a workaround for the RTL issue. I applied this in an Arabic E-Commerce React app.

Here is what I did.

I added a containerClass prop for the <Carousel>

<Carousel containerClass="carousel-with-custom-dots" {...rest} > {children} </Carousel>

Then I set the direction of .carousel-with-custom-dots to be ltr .carousel-with-custom-dots { direction: ltr; };

and it worked like a charm !

yaya1426 avatar Nov 08 '21 13:11 yaya1426

That makes it work in left to right direction. It moves the wrong way in RTL languages. It should start at the right, and move towards left for true RTL support. You stopped it from getting completely broken, but that's not the same as RTL support.

I ended up forking this repo and adding RTL support in a private repo. :(

On Mon, Nov 8, 2021 at 5:08 AM Yahya Elaraby @.***> wrote:

Hi, I seem to found a workaround for the RTL issue. I applied this in an Arabic E-Commerce React app.

Here is what I did.

I added a containerClass prop for the .

<Carousel containerClass="carousel-with-custom-dots" {...rest} > {children} </Carousel>

Then I set the direction of .carousel-with-custom-dots to be ltr .carousel-with-custom-dots { direction: ltr; };

and it worked like a charm !

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/YIZHUANG/react-multi-carousel/issues/56#issuecomment-963132785, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM5VCYENCSAYXP3XU5JRHLUK7DTHANCNFSM4IOLM63A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mctrafik avatar Nov 09 '21 05:11 mctrafik

The <Carousel /> component now accepts an rtl prop.

amir-ben-shimol avatar Jan 07 '24 15:01 amir-ben-shimol