-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[Tooltip]: ChangeDetection is triggered to often #15990
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
Comments
@dmkorol can you provide more information? How many times are you seeing change detection run? On which application were you measuring? How were you measuring? |
There is online reproduction: https://stackblitz.com/edit/angular-2g1mvi
I add a function on the view Desired behavior the tooltip should run change detection only once onShow or onHide. |
|
I found out if remove the second param from ComponentPortal components/src/material/tooltip/tooltip.ts Line 336 in 5284a57
the problem will disappear. do we really need to set it? |
A lot of this comes from the fact that we have Angular animation events for when an animation starts and when it finishes. There's an in-progress PR (#19432) that decouples the tooltip from the Angular's change detection cycle and should resolve this issue. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
What is the expected behavior?
Change detection runs once when component is shown or become hidden
What is the current behavior?
When move mouse over button ChangeDetection is run a lot of times in short period of time
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://stackblitz.com/edit/angular-2g1mvi
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
"@angular/material": "7.3.7",
The text was updated successfully, but these errors were encountered: