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

Column Width and Position Shifting During Pagination and Sorting #1261

Open
5 tasks done
r-jacko opened this issue Nov 18, 2024 · 0 comments
Open
5 tasks done

Column Width and Position Shifting During Pagination and Sorting #1261

r-jacko opened this issue Nov 18, 2024 · 0 comments

Comments

@r-jacko
Copy link

r-jacko commented Nov 18, 2024

Issue Check list

  • Agree to the Code of Conduct
  • Read the README
  • You are using React 16.8.0+
  • You installed styled-components
  • Include relevant code or preferably a code sandbox

Describe the bug

If the component has pagination enabled, switching between different pages can sometimes cause column widths to change. However, the bigger issue arises when sorting is enabled. If a user clicks on a column to sort it, after the sorting function is executed, a completely different column may end up under their cursor. This issue occurs especially in tables with narrow columns (e.g., displaying short numeric data) or tables with a large number of columns.

To Reproduce

Steps to reproduce the behavior:

  1. Open the default sandbox assigned to the GitHub issue template.
  2. Adjust the slider separating the code view and preview.
  3. Click on the 'Director' column to trigger sorting.
  4. Notice how the columns change their width and their position along the X-axis.

Expected behavior

Columns should retain their width and position during both sorting and page changes in pagination. This is probably not feasible for server-side pagination, but maybe it can be adjusted when that option is disabled.

Code Sandbox, Screenshots, or Relevant Code

Default sandbox.

Here the issue is demonstrated on a smaller section of a larger table (1920px width monitor, just a lot of data)
ezgif-3-78de8edc85
ezgif-3-47fc69f2e2

Versions (please complete the following information)

  • React (RDT requires 16.8.0+) → 18.2.0
  • RDT → 7.6.2
  • Styled Components → 5.3.11
  • OS: [e.g. iOS] → W11
  • Browser [e.g. chrome, safari, firefox] → Chrome, Brave, Firefox, basically anything
@r-jacko r-jacko changed the title [DESCRIPTION] Column Width and Position Shifting During Pagination and Sorting Nov 18, 2024
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