Skip to content

Commit

Permalink
Revert "fix: fixed pagination scale animation (#1552)"
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 b7cbade
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;

Check warning on line 204 in packages/components/pagination/src/use-pagination.ts

View workflow job for this annotation

GitHub Actions / ESLint

Expected blank line before this statement
}

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(() => {

Check warning on line 232 in packages/components/pagination/src/use-pagination.ts

View workflow job for this annotation

GitHub Actions / ESLint

Expected blank line before this statement
if (activePage && !originalProps.disableAnimation) {
scrollTo(activePage, activePage === activePageRef.current);
Expand Down

0 comments on commit b7cbade

Please sign in to comment.