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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user