Skip to content

fix(ui5-button): make aria-label work for ui5-button #1445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 24, 2020
1 change: 1 addition & 0 deletions packages/main/src/Button.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
tabindex={{tabIndexValue}}
aria-expanded="{{accInfo.ariaExpanded}}"
aria-controls="{{accInfo.ariaControls}}"
aria-label="{{ariaLabel}}"
title="{{accInfo.title}}"
part="button"
>
Expand Down
12 changes: 12 additions & 0 deletions packages/main/src/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ const metadata = {
type: Boolean,
},

/**
* Defines the aria-label attribute for the button
* @type {String}
* @defaultvalue: ""
* @private
* @since 1.0.0-rc.7
*/
ariaLabel: {
type: String,
defaultValue: undefined,
},

/**
* Indicates if the element if focusable
* @private
Expand Down
4 changes: 2 additions & 2 deletions packages/main/test/pages/Button.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<br/>
<br/>

<ui5-button icon="employee">Action Bar Button</ui5-button>
<ui5-button icon="download"></ui5-button>
<ui5-button icon="download" aria-label="Download application"></ui5-button>
<ui5-button icon="employee" aria-label="Download book">Action Bar Button</ui5-button>
<ui5-button icon="download"></ui5-button>

<br />
Expand Down