Skip to content

Commit

Permalink
Revert "Set aria-label to native button (#122)"
Browse files Browse the repository at this point in the history
This reverts commit a3592f5.
  • Loading branch information
Haprog committed Apr 10, 2019
1 parent 5cc28ea commit c451eaa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
24 changes: 0 additions & 24 deletions src/vaadin-button.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,6 @@
return '2.1.4';
}

static get properties() {
return {
/**
* Set the `aria-label` attribute for assistive technologies like
* screen readers. An `undefined` value for this property (the
* default) means that the `aria-label` attribute is not present at
* all.
*/
ariaLabel: {
type: String,
observer: '_ariaLabelChanged'
}
};
}

ready() {
super.ready();

Expand All @@ -162,7 +147,6 @@
this.$.button.setAttribute('role', 'presentation');

this._addActiveListeners();
this._ariaLabelChanged(this.ariaLabel);
}

/**
Expand All @@ -186,14 +170,6 @@
this.addEventListener('blur', () => this.removeAttribute('active'));
}

_ariaLabelChanged(ariaLabel) {
if (ariaLabel !== undefined && ariaLabel !== null) {
this.$.button.setAttribute('aria-label', ariaLabel);
} else {
this.$.button.setAttribute('aria-label', this.innerText);
}
}

/**
* @protected
*/
Expand Down
13 changes: 0 additions & 13 deletions test/vaadin-button_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,6 @@
vaadinButton.dispatchEvent(new CustomEvent('blur'));
expect(vaadinButton.hasAttribute('active')).to.be.false;
});

it('should set buttom text to native button aria-label', () => {
expect(nativeButton.hasAttribute('aria-label')).to.be.true;
// Remove extra line breaks
expect(nativeButton.getAttribute('aria-label').replace(/(\r\n|\n|\r)/gm, ''))
.to.contain(vaadinButton.innerText.replace(/(\r\n|\n|\r)/gm, ''));
});

it('should set button aria-label to native button aria-label', () => {
vaadinButton.ariaLabel = 'accessible';
expect(nativeButton.hasAttribute('aria-label')).to.be.true;
expect(nativeButton.getAttribute('aria-label')).to.be.eql(vaadinButton.ariaLabel);
});
});
</script>
</body>

0 comments on commit c451eaa

Please sign in to comment.