Skip to content

Commit

Permalink
Update scroller.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Dec 5, 2024
1 parent ac5a6cf commit e26ecfb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/scroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,12 @@ export const createWindowScroller = (
isHorizontal
);

// slight tech debt: this would otherwise need to be accounted for in store._getViewportSize in a way that's flexible for windowScroller
const scrollbarHeight = window.innerHeight - html.clientHeight;
const scrollbarWidth = window.innerHeight - html.clientWidth;
const viewportAdjustment =
align === "end" || align === "center"
? isHorizontal
? scrollbarWidth
: scrollbarHeight
? // scroll bar height/width
window.innerWidth - html.clientWidth
: window.innerHeight - html.clientHeight
: 0;

return (
Expand Down

0 comments on commit e26ecfb

Please sign in to comment.