Skip to content

Commit

Permalink
web/DonateOptionsCard: add 5px of tolerance for max position
Browse files Browse the repository at this point in the history
fixes right stepper not hiding itself in chrome when manually scrolled to the end
  • Loading branch information
wukko committed Sep 30, 2024
1 parent b4dd506 commit 31be604
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/components/donate/DonateOptionsCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
const scroll = (direction: "left" | "right") => {
const currentPos = donateList.scrollLeft;
const newPos = direction === "left" ? currentPos - 150 : currentPos + 150;
const maxPos = donateList.scrollWidth - donateList.getBoundingClientRect().width;
const newPos = direction === "left" ? currentPos - 150 : currentPos + 150;
donateList.scroll({
left: newPos,
Expand Down Expand Up @@ -171,7 +171,7 @@
bind:this={donateList}
on:wheel={() => {
const currentPos = donateList.scrollLeft;
const maxPos = donateList.scrollWidth - donateList.getBoundingClientRect().width;
const maxPos = donateList.scrollWidth - donateList.getBoundingClientRect().width - 5;
showLeftScroll = currentPos > 0;
showRightScroll = currentPos < maxPos && currentPos !== maxPos;
}}
Expand Down

0 comments on commit 31be604

Please sign in to comment.