Skip to content

Commit

Permalink
Add back piece for reverse scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
diksipav committed Mar 12, 2024
1 parent fd545bd commit f323ce3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion shared/common/ui/customScrollbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ export function CustomScrollbars({
const onScroll = useCallback(
(el: HTMLElement) => {
const scrollTop =
Math.max(0, el.scrollTop - scrollIgnoreLength) /
Math.max(
0,
reverse
? el.scrollHeight + el.scrollTop - el.clientHeight
: el.scrollTop - scrollIgnoreLength
) /
(el.scrollHeight - scrollIgnoreLength - el.clientHeight);

_scrollOffsets.current = [
Expand Down

0 comments on commit f323ce3

Please sign in to comment.