feat(alert): add htmlAttributes property for passing attributes to buttons (#27862)

Issue number: N/A

---------

## What is the current behavior?
Buttons containing only icons are not accessible as there is no way to
pass an `aria-label` attribute (or any other html attribute).

## What is the new behavior?
- Adds the `htmlAttributes` property on the `AlertButton` interface 
- Passes the `htmlAttributes` to the buttons
- Adds a test to verify `aria-label` and `aria-labelled-by` are passed
to the button

## Does this introduce a breaking change?

- [ ] Yes
- [x] No
This commit is contained in:
Brandy Carney
2023-07-31 13:16:17 -04:00
committed by GitHub
parent 5ce4ec0439
commit 06be0e5111
4 changed files with 36 additions and 0 deletions

View File

@ -666,6 +666,7 @@ export class Alert implements ComponentInterface, OverlayInterface {
<div class={alertButtonGroupClass}>
{buttons.map((button) => (
<button
{...button.htmlAttributes}
type="button"
id={button.id}
class={buttonClass(button)}