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

[css] carousel buttons error in RTL #37180

Closed
3 tasks done
Mohamed-Anes opened this issue Sep 20, 2022 · 3 comments · Fixed by #37266
Closed
3 tasks done

[css] carousel buttons error in RTL #37180

Mohamed-Anes opened this issue Sep 20, 2022 · 3 comments · Fixed by #37266
Labels

Comments

@Mohamed-Anes
Copy link

Mohamed-Anes commented Sep 20, 2022

Prerequisites

Describe the issue

In RTL bootstrap carousel, prev and next buttons have inverted functions, prev takes to next and next takes to previous.
It can be seen in the official bootstrap rtl carousel example

Reduced test cases

https://getbootstrap.com/docs/5.2/examples/carousel-rtl/

The fix I found is inverting the 'translateX()' values in the bootstrao.rtl.css file (and by extension other files using the same css code)

--Code before change:

.carousel-item-next:not(.carousel-item-start),
.active.carousel-item-end {
  transform: translateX(100%);
}

.carousel-item-prev:not(.carousel-item-end),
.active.carousel-item-start {
  transform: translateX(-100%);
}

--Code after change:

.carousel-item-next:not(.carousel-item-start),
.active.carousel-item-end {
  transform: translateX(-100%);
}

.carousel-item-prev:not(.carousel-item-end),
.active.carousel-item-start {
  transform: translateX(100%);
}

This section of code begins in the file bootstrap.rtl.css at line 5847 as of the current version

.carousel-item-next:not(.carousel-item-start),

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

v5.0.2

@Mohamed-Anes Mohamed-Anes changed the title label:css carousel buttons error in RTL :css: carousel buttons error in RTL Sep 20, 2022
@Mohamed-Anes Mohamed-Anes changed the title :css: carousel buttons error in RTL carousel buttons error in RTL label:css Sep 20, 2022
@Mohamed-Anes Mohamed-Anes changed the title carousel buttons error in RTL label:css [css] carousel buttons error in RTL Sep 20, 2022
@ffoodd
Copy link
Member

ffoodd commented Sep 20, 2022

What do you expect exactly?

RTL carousel first item is on the right and the last on the left, next button is on the left and prev on the right. I think that's the intended behavior for this feature. Am I missing something?

@Mohamed-Anes
Copy link
Author

@ffoodd, if you compare the carousel examples (the normal one with the RTL one), you see that

@ffoodd
Copy link
Member

ffoodd commented Sep 20, 2022

Aah yeah I see, in LTR translate follows arrows but in RTL it goes to the opposite.

ffoodd added a commit that referenced this issue Oct 6, 2022
@mdo mdo closed this as completed in #37266 Oct 6, 2022
mdo pushed a commit that referenced this issue Oct 6, 2022
julien-deramond pushed a commit that referenced this issue Nov 19, 2022
XhmikosR pushed a commit that referenced this issue Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants