primefaces / primefaces/primereact
DataTable: Allow resizable columns + frozen columns
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
I faced an issue with the DataTable when setting the table to be resizableColumns={true} along with scrollable={true}.
- When you freeze a column the header won't move on horizontal scroll along with the frozen column
- 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
- Go to CodeSandbox
- Scroll to the right and left
- See error: The header for the frozen column is not moving along with the column (
Balancecolumn)
Second
- Go to CodeSandbox
- Click on
Freeze Activitybutton - Scroll to the right and left
- See error:
- The header of the
Activitycolumn moved over the previous column, and still not moving along with the column on horizontal scroll, - There is a gap between the
Balancefrozen column and theActivityfrozen 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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox reproducer, especially src/demo/DataTableScrollDemo.js, and compare scrolling with and without resizableColumns. Investigate the DataTable behavior for frozen and resizable columns; done means frozen headers and columns stay aligned during horizontal scrolling, including when Activity is frozen, with no gap between frozen columns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100