From 7d294e3a042073542d58bf4fd5dc751a4c5117e0 Mon Sep 17 00:00:00 2001 From: Junior Garcia Date: Sat, 2 Sep 2023 17:45:49 -0300 Subject: [PATCH] Revert "fix: fixed pagination scale animation (#1552)" (#1553) This reverts commit 8fcc8b37670fc1c7823d2ef78ad459078d6c76f4. --- packages/components/pagination/src/use-pagination.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/components/pagination/src/use-pagination.ts b/packages/components/pagination/src/use-pagination.ts index c9fd5d653a..0b7b052694 100644 --- a/packages/components/pagination/src/use-pagination.ts +++ b/packages/components/pagination/src/use-pagination.ts @@ -201,7 +201,6 @@ export function usePagination(originalProps: UsePaginationProps) { if (skipAnimation) { cursorRef.current.setAttribute("data-moving", "false"); cursorRef.current.style.transform = `translateX(${offsetLeft}px) scale(1)`; - return; } @@ -212,13 +211,10 @@ export function usePagination(originalProps: UsePaginationProps) { cursorTimer.current = setTimeout(() => { // reset the scale of the cursor if (cursorRef.current) { + cursorRef.current.setAttribute("data-moving", "false"); cursorRef.current.style.transform = `translateX(${offsetLeft}px) scale(1)`; } - cursorTimer.current = setTimeout(() => { - // remove the data-moving attribute - cursorRef.current?.setAttribute("data-moving", "false"); - cursorTimer.current && clearTimeout(cursorTimer.current); - }, CURSOR_TRANSITION_TIMEOUT); + cursorTimer.current && clearTimeout(cursorTimer.current); }, CURSOR_TRANSITION_TIMEOUT); } @@ -233,7 +229,6 @@ export function usePagination(originalProps: UsePaginationProps) { }); const activePageRef = useRef(activePage); - useEffect(() => { if (activePage && !originalProps.disableAnimation) { scrollTo(activePage, activePage === activePageRef.current);