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

Page freezes on resize when using many pFrozenColumn #15816

Open
PronDmytro opened this issue Jun 10, 2024 · 2 comments
Open

Page freezes on resize when using many pFrozenColumn #15816

PronDmytro opened this issue Jun 10, 2024 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@PronDmytro
Copy link
Contributor

PronDmytro commented Jun 10, 2024

Describe the bug

The page is freezing on resize when using many pFrozenColumns.
In my work project, the page never unfreezes. I reproduced a similar table, and here the page freezes for 1-2 seconds.

Upd: When there are more rows, the freeze lasts longer.

It looks like the main problem is in this listener, because a listener is created for each instance of pFrozenColumn.

@HostListener('window:resize', ['$event'])
recalculateColumns() {
const siblings = DomHandler.siblings(this.el.nativeElement);
const index = DomHandler.index(this.el.nativeElement);
const time = (siblings.length - index + 1) * 50;
setTimeout(() => {
this.updateStickyPosition();
}, time);
}

Environment

Windows 11

Reproducer

No response

Angular version

17.3.0

PrimeNG version

17.18.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.12.1

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@PronDmytro PronDmytro added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 10, 2024
@nikolaSim
Copy link

This is critical, it freezes the whole application.

@lautarogfernandez
Copy link

Is there any news from this fix? it is also freezing the whole application when it tries to run this method updateStickyPosition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

3 participants