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

DataTable: VirtualScroller breaks when sort is applied #4434

Closed
zachlearnscode opened this issue Sep 12, 2023 · 2 comments
Closed

DataTable: VirtualScroller breaks when sort is applied #4434

zachlearnscode opened this issue Sep 12, 2023 · 2 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@zachlearnscode
Copy link

Describe the bug

The DataTable VirtualScroller displays empty table rows when a sort is applied to a column. The issue occurs after:

  1. a sort is applied somewhere in the middle of the dataset
  2. after applying a sort at the top of the dataset, then scrolling to a random location in the middle of the table.

On the other hand, if a sort is applied and the user scrolls the table slowly (ie one chunk of {first, last} at a time, the does not occur. Additionally, if you take the same steps without a sort applied, the DataTable responds as you'd expect.

Reproducer

https://codesandbox.io/s/primevue-demo-forked-ssgtwk?file=/src/App.vue

PrimeVue version

3.31.0

Vue version

3.x

Language

ES6

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Without a sort applied, scroll to a random location beyond the top of the table (you can do this with a scroll wheel or dragging the scroll bar with the cursor)
  2. Note that the table rows are loaded as expected
  3. Apply a sort
  4. Note that the table displays empty table rows.
  5. Scroll back to the top of the table and note that the issue corrects itself
  6. Scroll the table slowly and note that the issue doesn't occur
  7. Scroll again to a random location in the table and note that the table again displays empty rows

Expected behavior

When a sort is applied to a VirtualScroller DataTable, the table should work the same when a sort applied while scrolling quickly around the table

@zachlearnscode zachlearnscode added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 12, 2023
@zachlearnscode
Copy link
Author

bumping

@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 20, 2023
@mertsincan mertsincan added this to the 3.45.0 milestone Dec 20, 2023
@mertsincan
Copy link
Member

Fixed now. But, as you know, sorting in DataTable with lazy must be done by you. Please see the details; https://primevue.org/datatable/#lazy_load

Best Regards,

@mertsincan mertsincan self-assigned this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants