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

Fixed #15852 - Table: Frozen columns are displaced #15854

Merged
merged 5 commits into from
Aug 1, 2024

Conversation

ranthonissen
Copy link
Contributor

Fixed #15852 - Table: Frozen columns are displaced

Copy link

vercel bot commented Jun 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primeng ⬜️ Ignored (Inspect) Visit Preview Jun 17, 2024 2:21pm

@bartlomiej-dobosz
Copy link

Hi @ranthonissen
I haven't run your code but I just wanted to mention that the changes you made mostly undo the changes from this #15302 issue. Please check if your changes have not reversed that bug.

If so here is my qickfix:

recalculateColumns() {
        const siblings = DomHandler.siblings(this.el.nativeElement);
        const index = DomHandler.index(this.el.nativeElement);
        const time = this.alignFrozen === 'right' ? (siblings.length - index + 1) * 50 : (index + 1) * 50; //this line

        setTimeout(() => {
            this.updateStickyPosition();
        }, time);
        this.updateStickyPosition();
}

@ranthonissen
Copy link
Contributor Author

Hi @bartlomiej-dobosz,

As far as I am familiar with the code, the fix provided in #15302 did not solve the problem, but only delayed the calculation of the column position, causing this issue #15852.
The underlying issue was that DomHandler.getOuterWidth(next) and DomHandler.getOuterWidth(prev) in the updateStickyPosition() function always returned 0, because of the table not being rendered/displayed at the time of calculation.

I think this fix resolves that issue, making the delayed execution of updateStickyPosition() unnecessary.

@ranthonissen
Copy link
Contributor Author

I haven't tested it myself, but i might also fix #15816, as it is the same code portion that seems to cause that issue

@bartlomiej-dobosz
Copy link

I found bug. When you add more columns and start sorting, this happens:

image

@ranthonissen
Copy link
Contributor Author

@bartlomiej-dobosz
I'm unable to reproduce the behavior you show in your screenshot .
Can you provide me with code that shows this bug?

chrome_wnG8ynj2Mg

@ranthonissen
Copy link
Contributor Author

@bartlomiej-dobosz Any update on this PR?

The issues on the frozen columns are a showstopper for our team.
So if there is any way I can help and speed things up (with this and related frozen table column issues), don't hesitate to reach out to me, and I will see how I can help.

I think some more issues were introduced by #15302. So I think it might be a good idea to revert these changes, start over from that point with another approach, and closely keep an eye on the fix for the original issue #15303, and making sure no new issues get introduced.

@bartlomiej-dobosz
Copy link

Sorry I forgot to reply here.
I think the error I described above was the result of my mistake. Ignore it.
In my project I had to hack sorting to add a third state (ASC, DESC and NONE). And this affects your solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table: Frozen columns are displaced
3 participants