From c8cb8db7907d3c390f506de5fb2667681b6a55b6 Mon Sep 17 00:00:00 2001 From: Akshat Patel Date: Sat, 9 Nov 2024 18:44:17 -0500 Subject: [PATCH] fix: allow users to pass in aria-label for button Signed-off-by: Akshat Patel --- src/toggle/toggle.component.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/toggle/toggle.component.ts b/src/toggle/toggle.component.ts index cfea258fa7..9f955fa495 100644 --- a/src/toggle/toggle.component.ts +++ b/src/toggle/toggle.component.ts @@ -12,6 +12,7 @@ import { I18n } from "carbon-components-angular/i18n"; import { Observable } from "rxjs"; /** + * @deprecated since v5 - Use boolean * Defines the set of states for a toggle component. */ export enum ToggleState { @@ -50,7 +51,8 @@ export enum ToggleState { role="switch" type="button" [attr.aria-checked]="checked" - (click)="onClick($event)"> + (click)="onClick($event)" + [attr.aria-label]="ariaLabel">