primefaces / primereact

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

DataTable: Allow resizable columns + frozen columns #3415

Open ruben-ilciuc opened 2 years ago

ruben-ilciuc commented 2 years ago

Describe the bug

I faced an issue with the DataTable when setting the table to be resizableColumns={true} along with scrollable={true}.

  1. When you freeze a column the header won't move on horizontal scroll along with the frozen column
  2. If you freeze another column in the middle of the table the header moves to the previous column and also not moving along with the frozen column.

See the Steps to reproduce the behavior for both cases.

Reproducer

https://codesandbox.io/s/reverent-hodgkin-glb40y?file=/src/demo/DataTableScrollDemo.js

PrimeReact version

8.6.1

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

First

  1. Go to CodeSandbox
  2. Scroll to the right and left
  3. See error: The header for the frozen column is not moving along with the column (Balance column)

Second

  1. Go to CodeSandbox
  2. Click on Freeze Activity button
  3. Scroll to the right and left
  4. See error:
    • The header of the Activity column moved over the previous column, and still not moving along with the column on horizontal scroll,
    • There is a gap between the Balance frozen column and the Activity frozen column.

Expected behavior

First I would love to see that both the content of the column and the header are moving along on horizontal scroll. (As you see on the table without the resizableColumns property set.)

Second The same as for the first case + the gap shouldn't be there between the columns. (This is reproducible for both cases: resizableColumns set to true and false)

melloware commented 2 years ago

I closed https://github.com/primefaces/primereact/issues/2684 in favor of this ticket which has a better description.

pramodmd commented 1 year ago

Any update on this? I'm using 8.6.1 and issue still occurs

melloware commented 1 year ago

No update from the open source community. However, if you need this fix critically I suggest you consider PRO support.

manentai commented 10 months ago

we have this issue on our tables, would be great to solve it!

https://github.com/primefaces/primereact/assets/53038308/b18d14d4-9c8f-4817-8438-d19bf85b3a26