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

Improve event bindings on OverlayPanel and ContextMenu to avoid unnecessary change detection #3671

Closed
dbmbm opened this issue Aug 16, 2017 · 2 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@dbmbm
Copy link

dbmbm commented Aug 16, 2017

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)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.

http://plnkr.co/edit/pIKtgnZXEYNQA4cJed7k?p=preview

Current behavior
Every overlayPanel and contextMenu seems to trigger the change detection on every click in the page, even if they are not visible.

Expected behavior
The change detection should be triggered just one time for all (and maybe just if at least one is visible)

Minimal reproduction of the problem with instructions
see the plunker, it just has 3 overlaypanel and 2 contextMenu and a change detection counter. Click wherever in the page and you'll see the counter going up by five.

What is the motivation / use case for changing the behavior?
when combining multiple components that use an overlayPanel or a contextMenu, every click cause multiple change detections, causing lag when there are about 10/15 of them.

  • Angular version: 4.3.4

  • PrimeNG version: 4.1.2

  • Browser: Chrome 60

  • Language: TypeScript 2.4.2

@dbmbm dbmbm changed the title Multiple overlayPanel cause multiple change detections Multiple overlayPanel and/or contextMenu cause multiple change detections Aug 16, 2017
@dbmbm
Copy link
Author

dbmbm commented Aug 16, 2017

the same issue involve menu when setting popup property to true

@cagataycivici cagataycivici added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add Status: Pending Review Issue or pull request is being reviewed by Core Team labels Oct 19, 2017
@cagataycivici cagataycivici added this to the 4.2.3 milestone Oct 19, 2017
@cagataycivici cagataycivici self-assigned this Oct 19, 2017
@cagataycivici cagataycivici changed the title Multiple overlayPanel and/or contextMenu cause multiple change detections Improve event bindings on OverlayPanel and ContextMenu to avoid unnecessary change detection Oct 24, 2017
@cagataycivici cagataycivici removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Oct 24, 2017
@cagataycivici
Copy link
Member

5c86671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants