10

I have this code for buttons and I want to shows the tooptips for disabled button. This works fine in Firefox and IE, but does not work in Chrome. In Chrome, only the buttons that are enabled showed the tooltip.

<div *ngFor"let btn of buttons">
   <button [tooltip]="'Tooltip'" [disabled]="btn.disable">
</div>
svarog
  • 9,477
  • 4
  • 61
  • 77
matchi
  • 533
  • 2
  • 6
  • 17

1 Answers1

13

This solution works for me:

<div *ngFor"let btn of buttons">
   <div [tooltip]="'Tooltip'">
      <button class='btn' [disabled]="btn.disable">
   </div>
</div>

<style>
   .btn:disabled{
      pointer-events: none;
   }
<style>
matchi
  • 533
  • 2
  • 6
  • 17
  • 1
    This is also how I would have done it, but please consider leaving some explanation about what the code actually does, detailed answers get upvoted quickly. – svarog Nov 29 '17 at 09:01