-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding accessibility attributes to modal buttons and refactoring over…
…all accessiblity code
- Loading branch information
1 parent
99b83c1
commit bbbd7eb
Showing
6 changed files
with
47 additions
and
18 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
component/src/views/chat/input/buttons/buttonAccessility.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export class ButtonAccessibility { | ||
public static addAttributes(button: HTMLElement) { | ||
button.role = 'button'; | ||
button.setAttribute('tabindex', '0'); | ||
} | ||
|
||
public static addAriaBusy(button: HTMLElement) { | ||
button.setAttribute('aria-busy', 'true'); | ||
} | ||
|
||
public static removeAriaBusy(button: HTMLElement) { | ||
button.removeAttribute('aria-busy'); | ||
} | ||
|
||
public static addAriaDisabled(button: HTMLElement) { | ||
button.setAttribute('aria-disabled', 'true'); | ||
} | ||
|
||
public static removeAriaDisabled(button: HTMLElement) { | ||
button.removeAttribute('aria-disabled'); | ||
} | ||
|
||
public static removeAriaAttributes(button: HTMLElement) { | ||
ButtonAccessibility.removeAriaBusy(button); | ||
ButtonAccessibility.removeAriaDisabled(button); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters