matTooltip performance issue
See original GitHub issueBug:
When mouse hover event occurred on one of the matTooltip component, it causes reevaluation of all matTooltip components in a page. This only applies to matTooltips using a dynamic expression or a function.
What is the expected behavior?
Only the tooltip getting the mouse hover event should get reevaluated.
What is the current behavior?
All tooltips on the current view are getting evaluated regardless of whether they received hover event or not.
What are the steps to reproduce?
<button mat-raised-button [matTooltip]="test()">
Action 1
</button>
<button mat-raised-button [matTooltip]="test()">
Action 2
</button>
public test() {
console.log('test');
return 'test';
}
What is the use-case or motivation for changing an existing behavior?
We have a table/list with 1000 rows and each one of them have dynamic tooltip content. This bug prevents us from using tooltips on that view.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular: Angular Material: 5.x TypeScript: 2.5.3 NPM: 6.4.0 Node: 6.11.5 Browsers: Chrome OS: Windows
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
bug([mat-tooltip]): [high performance problem - tooltip triggers ...
Bootstrap tooltip works perfectly, without any rendering/performance issues.
Read more >Large number of mat-tooltip inside mat-table slows application
I found somewhere that tool-tip may impact your performance if there are large number of it. We have around 500 rows in 3...
Read more >Angular Material matToolTip does not display when using ngFor ...
However, adding a matToolTips within the ngFor does not get displayed. ... multiple issues like matToolTip not displaying as-well as performance issues.
Read more >Angular Material2 Issue (forked) - StackBlitz
<div class="basic-container">. Run your mouse left /right across these. buttons while recording a performance. profile. <div>. <button matTooltip="User".
Read more >[Solved]-Angular mat tooltip-angular.js - appsloveworld
Coding example for the question Angular mat tooltip-angular.js. ... Angular Mat tree re-render performance issue takes too much time · How to style...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think change detection for other tooltips on the page should get fired if they were not hovered.
The tooltip content is shown inside an overlay, if none of the other tooltips will be visible, why do we need to re-evaluate them?
This is how data binding works in general. All of the expression on the page will be re-evaluated when an event occurs.