mat tooltip on disabled button

Solutions on MaxInterview for mat tooltip on disabled button by the best coders in the world

showing results for - "mat tooltip on disabled button"
Ariadna
17 May 2016
1This doesn't work because it is triggered by mouseenter event which doesn't get fired by most browsers for disabled elements. A workaround is to add matTooltip to a parent element:
2<div matTooltip="You cannot delete that" [matTooltipDisabled]="!isButtonDisabled()">
3    <button mat-raised-button [disabled]="isButtonDisabled()">
4        <mat-icon>delete</mat-icon>
5    </button>
6</div>