How to change the title of an icon in Ionic

593 Views Asked by At

It's just a small issue, but I've looked into other posts but none of the solutions work (at least for me). I want to change the title that appears on hover. I've tried using pointer-events: none;, but it stops the onDelete function

<ion-icon name="trash-outline" (click)="onDelete(message)" class="del" ></ion-icon>

2

There are 2 best solutions below

0
AudioBubble On BEST ANSWER

As per the Ionic Forum post do the following:

<span title="whatever" (click)="onDelete(message)" >
  <ion-icon name="trash-outline" class="del"></ion-icon>
</span>

and in your css

.del {
  pointer-events:none
}

And here is the solution as a stackblitz.

0
Todd Hale On

I don't want any ion-icon svg title to show up in my app, so I put this in my index.html tag:

ion-icon {
  pointer-events: none;
}