Use correct auto scroll amount for x/y direction

This commit is contained in:
schroda
2024-12-27 03:12:19 +01:00
parent cff56c33e8
commit 0e9d758c10

View File

@@ -134,8 +134,8 @@ export const useAutomaticScrolling = (
const timeoutMs = handleScrollX ? timeoutMsX : timeoutMsY;
const scrollTopByBase = handleScrollY ? pxScrollAmountX : 0;
const scrollLeftByBase = handleScrollX ? pxScrollAmountY : 0;
const scrollTopByBase = handleScrollY ? pxScrollAmountY : 0;
const scrollLeftByBase = handleScrollX ? pxScrollAmountX : 0;
const scrollTopByReadingMode = scrollTopByBase;
const scrollLeftByReadingMode = isRTL ? -Math.abs(scrollLeftByBase) : scrollLeftByBase;
const scrollTopByInverted = invert ? -Math.abs(scrollTopByReadingMode) : scrollTopByReadingMode;