From ebf2d493aac48fa68b7c12d8a1fd3b8f72257fce Mon Sep 17 00:00:00 2001 From: wukko Date: Fri, 27 Sep 2024 21:01:41 +0600 Subject: [PATCH] web/DonateOptionsCard: update buttons on wheel too --- web/src/components/donate/DonateOptionsCard.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/components/donate/DonateOptionsCard.svelte b/web/src/components/donate/DonateOptionsCard.svelte index d4557a0f..2bfc36f3 100644 --- a/web/src/components/donate/DonateOptionsCard.svelte +++ b/web/src/components/donate/DonateOptionsCard.svelte @@ -169,7 +169,12 @@
{}} + on:wheel={() => { + const currentPos = donateList.scrollLeft; + const maxPos = donateList.scrollWidth - donateList.getBoundingClientRect().width; + showLeftScroll = currentPos > 0; + showRightScroll = currentPos < maxPos && currentPos !== maxPos; + }} > {#each Object.entries(PRESET_DONATION_AMOUNTS) as [amount, component]}