primefaces / primereact

The Most Complete React UI Component Library
https://primereact.org
MIT License
6.21k stars 962 forks source link

DataTable: Duplicate multi select column when reordering #6835

Open KirinDarkoJM opened 6 days ago

KirinDarkoJM commented 6 days ago

Describe the bug

When enabling column reorder functionality while having a <Column selectionMode="multiple" headerStyle={{ width: '3rem' }/> and <Column rowEditor /> in the same datatable, the selection mode column is duplicated for what ever reason.

Reproducer

https://stackblitz.com/edit/uvmba6-qcunpx?file=src%2FApp.jsx

PrimeReact version

10.7.0

React version

18.x

Language

ES6

Build / Runtime

Create React App (CRA)

Browser(s)

tested in edge and chrome

Steps to reproduce the behavior

  1. Reorder Name column to be after code

Seen result: Columns ended up as:

  1. Checkbox
  2. Category
  3. code
  4. quantity
  5. checkbox (AGAIN)
  6. edit

Expected behavior

Columns should be in the following order:

  1. Checkbox
  2. Category
  3. code
  4. quantity
  5. edit
melloware commented 6 days ago

Marked it as a bug. But as a warning not all datatable features are designed to work with other features. Having both reorderable rows and editable rows feels like a bad UI/UX