Skip to content

Commit

Permalink
Carousel: fix carousel scroll button in RTL (#13211)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushnirwal authored Apr 25, 2023
1 parent b70cb16 commit 39c9a73
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function useCarouselScroll({
);

const scrollByPx = carouselWidth;
const isAtStart = isRTL ? 1 === ratio : 0 === ratio;
const isAtEnd = isRTL ? 0 === ratio : 1 === ratio;
const isAtStart = isRTL ? 0 === ratio : 0 === ratio;
const isAtEnd = isRTL ? -1 === ratio : 1 === ratio;

const canScrollBack = hasOverflow && !isAtStart;
const canScrollForward = hasOverflow && !isAtEnd;
Expand Down

0 comments on commit 39c9a73

Please sign in to comment.