icflorescu / icflorescu/mantine-datatable
Improve compatibility between pagination and AutoAnimate
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing a paginated DataTable using AutoAnimate and changing pages, then inspect how pagination slices the data passed to the animated rows. Decide on the API behavior before implementing it; done means page changes do not animate every row, while underlying data changes can still animate appropriately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100