From f9dc788007e404e39159d299a97162e947be7bc0 Mon Sep 17 00:00:00 2001 From: Amit Sharma <74371312+Amit91848@users.noreply.github.com> Date: Sat, 4 Jan 2025 20:37:36 +0530 Subject: [PATCH] fix: It's hard to click on the last available Event Duration (#18462) --- packages/ui/components/apps/AllApps.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/ui/components/apps/AllApps.tsx b/packages/ui/components/apps/AllApps.tsx index 8543c7de45..02264aec24 100644 --- a/packages/ui/components/apps/AllApps.tsx +++ b/packages/ui/components/apps/AllApps.tsx @@ -32,14 +32,14 @@ export function useShouldShowArrows() { right: !isAtEnd, }); } - }, []); + }, [ref.current?.scrollWidth, ref.current?.clientWidth]); const calculateScroll = (e: UIEvent) => { + 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, }); };