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

mdTooltip is not working properly with ChangeDetectionStrategy.OnPush #2713

Closed
aralroca opened this issue Jan 19, 2017 · 3 comments · Fixed by #2721
Closed

mdTooltip is not working properly with ChangeDetectionStrategy.OnPush #2713

aralroca opened this issue Jan 19, 2017 · 3 comments · Fixed by #2721
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@aralroca
Copy link

Bug:

Inside a component with changeDetection: ChangeDetectionStrategy.OnPush the mdTooltip is not working properly.

What is the expected behavior?

When the mouse is over the element, the tooltip is showed, and when the mouse leave the element, the tooltip is hidden.

What is the current behavior?

Show the tooltip sometimes when the mouse leave, sometimes never, sometimes when the mouse is over... Is not always the same behavior.

Which versions of Angular, Material, OS, browsers are affected?

Browser: Chrome 55.0.2883.95 (64-bit)

angular-cli: 1.0.0-beta.24
node: 6.7.0
os: darwin x64
@angular/common: 2.4.1
@angular/compiler: 2.4.1
@angular/core: 2.4.1
@angular/forms: 2.4.1
@angular/http: 2.4.1
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.1
@angular/platform-browser-dynamic: 2.4.1
@angular/router: 3.4.1
@angular/compiler-cli: 2.4.1
@thomaspink
Copy link
Contributor

Can reproduce it in the demo-app.

I think the problem is because the internal TooltipComponent has a _visibility property that changes state but the change detection does not recognize it because you skipped the sub component tree. So the animation does not get triggered and will show/hide the tooltip.

In my opinion even when change detection is onPush the tooltip should work fine. I will have a look on it maybe file a PR.

Maybe @jelbourn @kara @devversion do have an idea/opinion?

@jelbourn jelbourn added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jan 19, 2017
@jelbourn
Copy link
Member

One of our goals for exiting beta is that all of the components work with OnPush, so it's definitely something we want to address. PRs are always welcome!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants