primeng icon indicating copy to clipboard operation
primeng copied to clipboard

OverlayPanel performance issue

Open fxmfr opened this issue 9 years ago • 2 comments

I'm submitting a ... (check one with "x")

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports) http://plnkr.co/edit/LMvtleJc1CFfo4cMyRQQ?p=preview

Current behavior Using a lot of OverlayPanels causes performance issue due to many active document click event listeners.

Expected behavior Assumed that document's click listener is only needed for detection if click happened outside overlay, it should only be attached when overlay is shown (and detached when overlay hides).

Minimal reproduction of the problem with instructions In plunkr above, check documents click event listeners in dev tools. There are 10(!) of them.

What is the motivation / use case for changing the behavior? Avoid performance issues.

Please tell us about your environment: Windows 10, Angular 4.2.4, Primeng 4.1.0 RC2 (but 4.1.3 also affected), all Browsers

fxmfr avatar Aug 17 '17 14:08 fxmfr

every listener seem to cause a change detection run, so 10 overlay -> 10 change detection run per click. The same apply to context-menu and menu components (when using popup). see #3671

dbmbm avatar Aug 18 '17 08:08 dbmbm

Duplicate of #3671

cagataycivici avatar Oct 20 '17 07:10 cagataycivici