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

Unexpected behaviour with right to left direction #97

Closed
abisar opened this issue Aug 21, 2018 · 5 comments
Closed

Unexpected behaviour with right to left direction #97

abisar opened this issue Aug 21, 2018 · 5 comments

Comments

@abisar
Copy link

abisar commented Aug 21, 2018

My body tag has direction: rtl. If I swipe from left to right, my expected behaviour is I want to go from slide 1 to slide 2 but it tries to go from slide 1 to 0 which doesn't exist.

Is there any support for RTL direction? It's basically an inversion of everything related to x-axis.

@tim-steele
Copy link
Contributor

At this time we haven't added support to it. It is something we can look at doing, but we are also open to a pull request.

@mrbinky3000
Copy link
Collaborator

@abisar so, when I drag the slide from the left to the right, the slider would animate in the opposite direction from right to left?

Or, are you talking about the ButtonNext and ButtonBack components? If you are talking about the buttons, simply place ButtonNext on the left side of your carousel and ButtonBack on the right side.

If you are using the Dot component, simply display them from high to low.

Basically, you can place the buttons "backwards" and simulate rtl behavior. The only question I have is about inverting the dragging? I tried to find other carousels that do this. Do you know of one so I can check it out?

@akramabdulrahman
Copy link

akramabdulrahman commented Dec 4, 2020

@tim-steele

well I am having the same problem under dir="RTL", if there was an invert option for the drag I mean like
drag=invert
that would just invert the translation animation.
right now in rtl this is what happens
ezgif-7-da03d814b682

I haven't read the lib yet , I need this to be enabled , gonna see if i can check it out .
shared this to make sure i know what needs to be done .

-see where the drag event is being made. if the provider has an invertDrag prop with true x will become window.width - x
if the thing is vertical its window.height -y

thanks for this carousel O.o

@akramabdulrahman
Copy link

tried to clone the thing and change things up :D the scripts arent exactly made for windows and such :D this might take a while

@tim-steele
Copy link
Contributor

@akramabdulrahman if an invert feature needs to happen, then we are open for a pull request.

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

No branches or pull requests

4 participants