Improved table flash on reload (#16419)
This PR fixes https://github.com/twentyhq/core-team-issues/issues/1732 There is still some room for improvement but the main goal is reached : removing the flash effect each time the table virtualization has to recompute due to an update after initial loading. # QA ## Create https://github.com/user-attachments/assets/1b4fc307-42ce-4ba6-b557-68ac7fcad40f ## Update with sort https://github.com/user-attachments/assets/e0700f44-8926-4395-8ab8-b32773f21de8 ## Update with filter https://github.com/user-attachments/assets/d325f85a-1a7b-4366-aac3-250331be7575 ## Soft delete https://github.com/user-attachments/assets/2c980183-c637-4aa7-a0ca-244e61396b20 ## Restore and destroy https://github.com/user-attachments/assets/01af9ec7-b442-4686-a1d7-ea1fc543fe62 ## Drag & drop https://github.com/user-attachments/assets/bba76bdb-d4ec-433d-b44e-37fdb9952b06 --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
co-authored by
Charles Bochet
parent
3cea19baf4
commit
ec8773437e
@@ -0,0 +1,3 @@
|
||||
export const mapById = <T extends { id: string }>(itemToMap: T) => {
|
||||
return itemToMap.id;
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
export const mapByProperty =
|
||||
<T extends { id: string }>(propertyName: keyof T) =>
|
||||
(itemToMap: T) => {
|
||||
return itemToMap[propertyName];
|
||||
};
|
||||
Reference in New Issue
Block a user