primereact icon indicating copy to clipboard operation
primereact copied to clipboard

[DataTable]: drag selection is enabled automatically when enabling rows reorder

Open BAISTM opened this issue 9 months ago • 6 comments

Describe the bug

Enabling rows reorder makes the drag selection active and there is not way to disable it.

Reproducer

https://stackblitz.com/edit/gu8bylvi?file=src%2FApp.jsx

System Information

primereact: 10.9.1

Steps to reproduce the behavior

No response

Expected behavior

No response

BAISTM avatar Feb 18 '25 10:02 BAISTM

This may be a dumb question but don't you need to be able to drag the rows to re-order them?

melloware avatar Feb 18 '25 12:02 melloware

@melloware You're correct but the issue here is something else. The datatable has singleSelection set but as soon as you enable reorder, the table uses drag-multiselect so it enables the dragSelection property.

sja-cslab avatar Feb 18 '25 12:02 sja-cslab

Right @sja-cslab, multiple rows can be selected by dragging a row even if the selection mode is Single (cf: screenshot).

Image

BAISTM avatar Feb 18 '25 12:02 BAISTM

Could you try that with primereact 10.9.2? We had some changes in the Datatable-Component around multi selection

sja-cslab avatar Feb 18 '25 12:02 sja-cslab

The reproducer uses the version 10.9.2 of primereact

Image

BAISTM avatar Feb 18 '25 12:02 BAISTM

OK marked as bug!

melloware avatar Feb 18 '25 12:02 melloware