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

DataTables Multiselect Broken With Column Sorting #7093

Closed
nikcich opened this issue Aug 30, 2024 · 3 comments · Fixed by #7554
Closed

DataTables Multiselect Broken With Column Sorting #7093

nikcich opened this issue Aug 30, 2024 · 3 comments · Fixed by #7554
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@nikcich
Copy link

nikcich commented Aug 30, 2024

Describe the bug

DataTable multi-select using shift+click is broken when sorting by a column. I sort by column B then click on element 0, shift_click down to element 5 and it doesn't select elements 0-5 it selects what I believe to be elements 0-5 of the DEFAULT sorting order, which to the end user looks almost like its randomly selecting elements.

2024-08-30.08-14-05.mp4

Reproducer

https://stackblitz.com/edit/vitejs-vite-nvgvfm?file=src%2FApp.jsx

System Information

Node: 18.20.3
    Yarn: 1.22.19
    npm: 10.2.3
    pnpm: 8.15.6

    primereact: 10.8.2 => 10.8.2 
    react: ^18.2.0 => 18.2.0

Steps to reproduce the behavior

Sort by a column so that it is not in the default sorting order
Click an element
Shift+click another element
Note that it is not selecting the rows expected

Expected behavior

Select the rows in the range selected based on the displayed row order.

@nikcich nikcich added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 30, 2024
@nikcich nikcich changed the title Replace_With_Component_Name: Brief_Bug_Description DataTables Multiselect Broken With Column Sorting Aug 30, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 30, 2024
@mar-cro
Copy link

mar-cro commented Dec 26, 2024

Hi, here the same behavior, exist a workaround to bypass the bug?

@chmilk1
Copy link

chmilk1 commented Jan 2, 2025

@mar-cro

Ive been having this problem too, its a big sticking point in the product im working on. What I did was create a button to put the user into 'selection mode', then disable the reset and disable all sorting on the table while the user can select things. (use a forward ref for resting sorting and remove 'sortable' from column) It doesn't look like this ticket is being worked on any time soon, so this workaround will have to do.

@melloware
Copy link
Member

This was attempted to be fixed in 10.9.1 with this ticket: #7468 but getting reports it is still not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants