primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Fixed #15852 - Table: Frozen columns are displaced

Open ranthonissen opened this issue 1 year ago • 6 comments

Fixed #15852 - Table: Frozen columns are displaced

ranthonissen avatar Jun 17 '24 14:06 ranthonissen

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

vercel[bot] avatar Jun 17 '24 14:06 vercel[bot]

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();
}

bartlomiej-dobosz avatar Jun 21 '24 15:06 bartlomiej-dobosz

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 avatar Jun 24 '24 06:06 ranthonissen

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

ranthonissen avatar Jun 24 '24 06:06 ranthonissen

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

image

bartlomiej-dobosz avatar Jun 25 '24 14:06 bartlomiej-dobosz

@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 avatar Jun 27 '24 13:06 ranthonissen

@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.

ranthonissen avatar Jul 15 '24 09:07 ranthonissen

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.

bartlomiej-dobosz avatar Jul 15 '24 13:07 bartlomiej-dobosz