question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

matTooltip performance issue

See original GitHub issue

Bug:

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:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
karan-kangcommented, Sep 24, 2018

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?

1reaction
crisbetocommented, Sep 24, 2018

This is how data binding works in general. All of the expression on the page will be re-evaluated when an event occurs.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found