Skip to content

Commit

Permalink
allow tooltip for disabled button through input
Browse files Browse the repository at this point in the history
  • Loading branch information
klaascuvelier committed Nov 20, 2024
1 parent 38b809a commit 06df8ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/button/icon-button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ButtonSize, ButtonType } from "./button.types";
<cds-tooltip
class="cds--icon-tooltip"
[description]="description"
[disabled]="disabled"
[disabled]="showTooltipWhenDisabled ? false : disabled"
[caret]="caret"
[dropShadow]="dropShadow"
[highContrast]="highContrast"
Expand Down Expand Up @@ -123,6 +123,10 @@ export class IconButton extends BaseIconButton implements AfterViewInit {
* The string or template content to be exposed by the tooltip.
*/
@Input() description: string | TemplateRef<any>;
/**
* Indicates whether the tooltip should be shown when the button is disabled
*/
@Input() showTooltipWhenDisabled = false;

/**
* Common button events
Expand Down

0 comments on commit 06df8ea

Please sign in to comment.