Skip to content

Commit

Permalink
Merge pull request #96 from inokawa/improve-rtl
Browse files Browse the repository at this point in the history
Improve handling of rtl
  • Loading branch information
inokawa authored Jun 4, 2023
2 parents e82a284 + 54ce146 commit 63bd6be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const hasNegativeOffsetInRtl = once((scrollable: HTMLElement) => {
const key = "scrollLeft";
const prev = scrollable[key];
scrollable[key] = 1;
const isNegative = scrollable[key] === 0;
// scrollLeft can be positive under some specific situations even if negative mode, so we use `<` for now.
const isNegative = scrollable[key] < 1;
scrollable[key] = prev;
return isNegative;
});

0 comments on commit 63bd6be

Please sign in to comment.