Skip to content

Commit

Permalink
fix(bx-header-menu): add button role (#10440)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

Fixes #10392

### Description

This PR adds `role="button"` to the `<a>` tags inside the L0 menu. This improves accessibility by identifying these elements are acting as buttons. 

> The button role identifies an element as a button to assistive technology such as screen readers. A button is a widget used to perform actions such as submitting a form, opening a dialog, canceling an action, or performing a command such as inserting a new record or displaying information.

### Changelog

**New**

- Markup for `<a>` tags in dropdown menu items now includes `role="button"`.
  • Loading branch information
pjudge authored May 19, 2023
1 parent 71b5a4d commit c5d8c5d
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ class BXHeaderMenu extends HostListenerMixin(FocusMixin(LitElement)) {
return html`
<a
part="trigger"
role="button"
tabindex="0"
class="${prefix}--header__menu-item ${prefix}--header__menu-title"
href="javascript:void 0"
Expand Down

0 comments on commit c5d8c5d

Please sign in to comment.