Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve compatibility between pagination and AutoAnimate #688

Open
juliusn opened this issue Jan 9, 2025 · 0 comments
Open

Improve compatibility between pagination and AutoAnimate #688

juliusn opened this issue Jan 9, 2025 · 0 comments

Comments

@juliusn
Copy link

juliusn commented Jan 9, 2025

Paginated DataTable with AutoAnimate displays animation on all rows when changing pages.

Animations should apply only on changes in the underlying data array instead of the slice that DataTable uses for populating pages.

A simple solution would be to disable animations on page changes altogether or by a property.

<DataTable
  bodyRef={bodyRef}
  disableAnimationOnPageChange={true}
  // ...
/>

Another solution would be to expose a property that takes the original array (and id accessor?) for determining how to run animations. This way the responsiveness could be optimized further, for example by disabling animation for pre-existing rows that appear in bottom after a row has been removed, or for changes that are caused by sorting/filtering.

<DataTable
  bodyRef={bodyRef}
  data={data}
  // ...
/>

I don't pretend to know what a good API implementation would look like, just trying to give a general idea of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant