-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Dropdown does not hide on Push ChangeDetection #1754
Comments
Also, it would be great if OnPush change detection could be added to the roadmap for all primeng components. |
For anyone having the same problem, here's a quick and dirty hack to force Dropdown update with OnPush strategy: Dropdown.prototype.originalHide = Dropdown.prototype.hide;
Dropdown.prototype.hide = function() {
this.originalHide();
this.cd.markForCheck();
};
Dropdown.prototype.originalUnbindDocumentClickListener = Dropdown.prototype.unbindDocumentClickListener;
Dropdown.prototype.unbindDocumentClickListener = function () {
this.originalUnbindDocumentClickListener();
this.cd.markForCheck();
}; |
@cagataycivici PR ready for review: https://github.com/primefaces/primeng/pull/2159/files |
I've added a document:click listener, but prefer a solution from prime
|
I see, this issue is different than the one we fixed. I've added the check to fix it. Thanks. |
Can you re-open the issue until it's fixed? It would help prevent others logging a duplicate issue. |
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
http://plnkr.co/edit/rbQWTdX8EbVHfHvqu42E
Current behavior
Create a component that implements OnPush change detection strategy and use the primeng dropdown component within it. Click the dropdown to open the select list panel click outside the dropdown (and don't hover the mouse back inside the panel). The panel stays open and doesn't close.
Expected behavior
The panel should close.
Minimal reproduction of the problem with instructions
See steps above
What is the motivation / use case for changing the behavior?
I have components that require the performance benefits of OnPush that I'd like to also use the dropdown component within, but cannot due to this.
Angular version: 2.1.X
PrimeNG version: 1.0.1
Browser: All
Language: All
The text was updated successfully, but these errors were encountered: