From 31be60484de8eaf63bba8a4f508e16438aa7ba6e Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 30 Sep 2024 18:16:52 +0600 Subject: [PATCH] web/DonateOptionsCard: add 5px of tolerance for max position fixes right stepper not hiding itself in chrome when manually scrolled to the end --- web/src/components/donate/DonateOptionsCard.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/donate/DonateOptionsCard.svelte b/web/src/components/donate/DonateOptionsCard.svelte index 2cb29a1c..dcd1d03c 100644 --- a/web/src/components/donate/DonateOptionsCard.svelte +++ b/web/src/components/donate/DonateOptionsCard.svelte @@ -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, @@ -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; }}