Skip to content

Commit

Permalink
Update scroller.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Jan 20, 2024
1 parent 24dd4f3 commit 7d98882
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/core/scroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7d98882

Please sign in to comment.