No need to default `aria-label` to label.

This commit is contained in:
Guo Xiang Tan 2018-03-28 09:11:50 +08:00
parent 08d68e846c
commit 8bc5da57b0
2 changed files with 5 additions and 14 deletions

View File

@ -6,7 +6,7 @@ export default Ember.Component.extend({
tagName: 'button',
classNameBindings: [':btn', 'noText', 'btnType'],
attributeBindings: ['disabled', 'translatedTitle:title', 'ariaLabel:aria-label', 'tabindex'],
attributeBindings: ['disabled', 'translatedTitle:title', 'translatedTitle:aria-label', 'tabindex'],
btnIcon: Ember.computed.notEmpty('icon'),
@ -31,11 +31,6 @@ export default Ember.Component.extend({
if (label) return I18n.t(label);
},
@computed("translatedTitle", "translatedLabel")
ariaLabel(translatedTitle, translatedLabel) {
return translatedTitle ? translatedTitle : translatedLabel;
},
click() {
this.sendAction("action", this.get("actionParam"));
return false;

View File

@ -28,18 +28,14 @@ export const ButtonClass = {
buildAttributes() {
const attrs = this.attrs;
const attributes = {};
let title;
if (attrs.title) {
title = I18n.t(attrs.title, attrs.titleOptions);
const title = I18n.t(attrs.title, attrs.titleOptions);
attributes["aria-label"] = title;
attributes.title = title;
}
let label;
if (attrs.label) {
label = I18n.t(attrs.label, attrs.labelOptions);
}
const attributes = { "aria-label": label, title };
if (attrs.disabled) { attributes.disabled = "true"; }
if (attrs.data) {