From 3238103ca0bbfd8e18be1775a60104c89e71d3a8 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sun, 29 Dec 2024 22:14:44 +0100 Subject: [PATCH] Fix "rtl" detection in "useMouseDragScroll" "isRTL" was set to the direction value instead of correctly to the boolean flag indicating if it is the actual rtl direction value. This didn't cause any issues because for ltr because for ltr the result of "scrollAtT0.current[X] - delta[X])" was never less than "-maxScrollPos[X]" and for rtl it always used the expected value since "isRTL" was truthy. --- src/modules/core/hooks/useMouseDragScroll.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/core/hooks/useMouseDragScroll.tsx b/src/modules/core/hooks/useMouseDragScroll.tsx index b81aacd4..8f896198 100644 --- a/src/modules/core/hooks/useMouseDragScroll.tsx +++ b/src/modules/core/hooks/useMouseDragScroll.tsx @@ -49,7 +49,7 @@ export const useMouseDragScroll = ( elementStyle.current = getComputedStyle(element); } - const isRTL = elementStyle.current.direction; + const isRTL = elementStyle.current.direction === 'rtl'; const handleScrollX = scrollDirection !== ScrollDirection.Y; const handleScrollY = scrollDirection !== ScrollDirection.X;