Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeTable: Header's columns not aligned with body's columns in scrollable mode #5487

Closed
FAMSTM opened this issue Dec 1, 2023 · 4 comments · Fixed by #5511 or #5703
Closed

TreeTable: Header's columns not aligned with body's columns in scrollable mode #5487

FAMSTM opened this issue Dec 1, 2023 · 4 comments · Fixed by #5511 or #5703
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@FAMSTM
Copy link

FAMSTM commented Dec 1, 2023

Describe the bug

In scrollable mode, the header (containing the columns titles) and the body are in 2 separated tables, so the header's columns are not always aligned with the body's columns.
scrollable-treetable

Reproducer

https://codesandbox.io/p/sandbox/primereact-demo-forked-xwsn9c

PrimeReact version

10.1.1

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

Chrome 119

Steps to reproduce the behavior

In the table of the reproducer, scroll on the right side and watch the shift between the titles and the body.

Expected behavior

TreeTable in scrollable mode should have the same structure than in no-scrollable mode, with the titles and body cells in the same table

@FAMSTM FAMSTM added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 1, 2023
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 1, 2023
@kl-nevermore
Copy link
Contributor

kl-nevermore commented Dec 4, 2023

scrollHeaderBoxRef.current.style.marginLeft = -1 * scrollBodyRef.current.scrollLeft + 'px';

I used transform instead of marginLeft it worked

  scrollHeaderBoxRef.current.style.transform = `translateX(-${scrollBodyRef.current.scrollLeft}px)`;

20231204154926_rec_

@FAMSTM
Copy link
Author

FAMSTM commented Jan 8, 2024

The fix in v10.3.0 doesn't solve the problem, there is still a shift between the header's and body's columns
screenshot

@melloware
Copy link
Member

@kl-nevermore lets check if this fix was accidentally reverted as well.

@melloware melloware reopened this Jan 8, 2024
@melloware melloware modified the milestones: 10.3.0, 10.3.1 Jan 8, 2024
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 8, 2024
@melloware melloware removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 8, 2024
melloware added a commit to melloware/primereact that referenced this issue Jan 8, 2024
@melloware melloware modified the milestones: 10.3.1, 10.4.0 Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
3 participants