fix: It's hard to click on the last available Event Duration (#18462)

This commit is contained in:
Amit Sharma
2025-01-04 15:07:36 +00:00
committed by GitHub
parent 6e293d2985
commit f9dc788007
+5 -5
View File
@@ -32,14 +32,14 @@ export function useShouldShowArrows() {
right: !isAtEnd,
});
}
}, []);
}, [ref.current?.scrollWidth, ref.current?.clientWidth]);
const calculateScroll = (e: UIEvent<HTMLUListElement>) => {
const target = e.currentTarget;
const isAtEnd = target.scrollWidth <= target.clientWidth + target.scrollLeft + 1;
setShowArrowScroll({
left: e.currentTarget.scrollLeft > 0,
right:
Math.floor(e.currentTarget.scrollWidth) - Math.floor(e.currentTarget.offsetWidth) !==
Math.floor(e.currentTarget.scrollLeft),
left: target.scrollLeft > 0,
right: !isAtEnd,
});
};