React-responsive-carousel: RTL support for right to left language for arabic user

Created on 20 Dec 2018  路  5Comments  路  Source: leandrowd/react-responsive-carousel

wontfix

Most helpful comment

Add a style class that includes direction: 'initial' to the Carousel component. It works for both directions.

All 5 comments

Add a style class that includes direction: 'initial' to the Carousel component. It works for both directions.

I also experienced this issue and tried @alinavaie 's solution but it did not work. I see the carousel but not the content. when changing the direction back to 'ltr' it woks fine.
Can you help out?

I found a way to make this component RTL (if by RTL you mean that swiping the images will be from right to left):

<Carousel selectedItem={length(allMedia) - 1} > {mapIndexed(createImage())(reverse(allMedia))} </Carousel>

basically the idea is to set the selectedItem prop to the last index of your images array + reverse the order of the images in the array.

in this way the images will be in the correct order and swiping will be from right to left.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Add a style class that includes direction: 'initial' to the Carousel component. It works for both directions.

this works fine for me. I added the style class to the parent div of the Carousel component.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PatrikKozak picture PatrikKozak  路  3Comments

LeopoldLerch picture LeopoldLerch  路  5Comments

sprlwrksAprilmintacpineda picture sprlwrksAprilmintacpineda  路  6Comments

ledbetterljoshua picture ledbetterljoshua  路  6Comments

sinaler picture sinaler  路  3Comments