From 7d98882ca94d68db5aa6c645d315ad23ae671cb3 Mon Sep 17 00:00:00 2001 From: inokawa <48897392+inokawa@users.noreply.github.com> Date: Sat, 20 Jan 2024 15:07:25 +0900 Subject: [PATCH] Update scroller.ts --- src/core/scroller.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/scroller.ts b/src/core/scroller.ts index 7beebd3f0..5b609b18c 100644 --- a/src/core/scroller.ts +++ b/src/core/scroller.ts @@ -17,15 +17,14 @@ import { import { ScrollToIndexOpts } from "./types"; import { debounce, timeout, clamp } from "./utils"; -/** - * scrollLeft is negative value in rtl direction. - * - * left right - * -100 0 spec compliant - * https://github.com/othree/jquery.rtl-scroll-type - */ const normalizeOffset = (offset: number, isHorizontal: boolean): number => { if (isHorizontal && isRTLDocument()) { + // scrollLeft is negative value in rtl direction. + // + // left right + // 0 100 spec compliant (ltr) + // -100 0 spec compliant (rtl) + // https://github.com/othree/jquery.rtl-scroll-type return -offset; } else { return offset;