Skip to content

Commit

Permalink
Revert "fix: fixed pagination scale animation (#1552)" (#1553)
Browse files Browse the repository at this point in the history
This reverts commit 8fcc8b3.
  • Loading branch information
jrgarciadev authored Sep 2, 2023
1 parent 43906f6 commit 7d294e3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/components/pagination/src/use-pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
}

Expand All @@ -233,7 +229,6 @@ export function usePagination(originalProps: UsePaginationProps) {
});

const activePageRef = useRef(activePage);

useEffect(() => {
if (activePage && !originalProps.disableAnimation) {
scrollTo(activePage, activePage === activePageRef.current);
Expand Down

0 comments on commit 7d294e3

Please sign in to comment.