primefaces / primefaces/primereact
DataTable: Column width changes while scrolling if the content width is varied
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
As discussed previously here, there's no obvious/immediate way to make the column width to have fixed width (but still adjustable on drag and drop) if the content of the cells have different widths. It's very easy to reproduce on an infinite scroll DataTable while scrolling down.
Reproducer
https://stackblitz.com/edit/mhjis6?file=src%2Fservice%2FCarService.jsx
PrimeReact version
10.6.6
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
- Go to the stackblitz project or clone the project with infinite scroll and make a column content with longer width
- Scroll down and see the column width change/jump
Expected behavior
I understand that this behaviour can be beneficial for some but it would be useful to have a way to make the column width fixed regardless its content
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 StackBlitz reproducer, especially src/service/CarService.jsx, and run the infinite-scroll DataTable while scrolling through rows with varying content widths. Trace the DataTable column sizing behavior and verify that columns remain fixed while scrolling but can still be resized by dragging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100