Skip to content

Bugfix/index column header scroll reset#169

Merged
j-gojariya merged 3 commits intomainfrom
bugfix/index-column-header-scroll-reset
Feb 12, 2026
Merged

Bugfix/index column header scroll reset#169
j-gojariya merged 3 commits intomainfrom
bugfix/index-column-header-scroll-reset

Conversation

@j-gojariya
Copy link
Contributor

This pull request improves the usability of the TanStack table by preserving the horizontal scroll position when sorting, especially for server-side sorting scenarios. It also adds a new Storybook story to demonstrate and test this feature. The most important changes are grouped below:

Scroll Position Preservation on Sorting:

  • Added logic in useDataTable (Table.tsx) to save the scroll position before sorting and restore it after new data arrives, ensuring a smoother user experience during both client-side and server-side sorting. [1] [2]
  • Updated the DraggableColumnHeader and related components to trigger scroll position saving before a sort action is initiated. [1] [2] [3]

Storybook Demonstration and Testing:

  • Added a new Storybook story (ServerSideSortingTest) that simulates server-side sorting and visually demonstrates scroll position preservation, including a loading indicator and test instructions.
  • Updated Storybook imports to support the new story and sorting state management.

Minor UI/Style Update:

  • Added a bg-white class to table header cells for improved appearance.

Other:

  • Bumped the package version in package.json to 1.0.60.

@j-gojariya j-gojariya merged commit 8380ca9 into main Feb 12, 2026
1 check passed
@j-gojariya j-gojariya deleted the bugfix/index-column-header-scroll-reset branch February 12, 2026 09:02
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

Successfully merging this pull request may close these issues.

2 participants