mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-28 02:26:10 +00:00
web/DonateOptionsCard: add 5px of tolerance for max position
fixes right stepper not hiding itself in chrome when manually scrolled to the end
This commit is contained in:
parent
b4dd506f61
commit
31be60484d
|
@ -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;
|
||||
}}
|
||||
|
|
Loading…
Reference in a new issue