Accessibility popup close button (#7794)

* Change color of close button #7539

* Add role=button and aria-label #7399

* Add aria-hidden to `times` / `x` #7472

* remove bold on close button

Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
This commit is contained in:
Falke Design
2021-11-25 18:50:18 +01:00
committed by GitHub
parent c6c82f07c5
commit 1180e7e8c2
2 changed files with 5 additions and 4 deletions

View File

@ -190,8 +190,10 @@ export var Popup = DivOverlay.extend({
if (this.options.closeButton) {
var closeButton = this._closeButton = DomUtil.create('a', prefix + '-close-button', container);
closeButton.setAttribute('role', 'button'); // overrides the implicit role=link of <a> elements #7399
closeButton.setAttribute('aria-label', 'Close popup');
closeButton.href = '#close';
closeButton.innerHTML = '&#215;';
closeButton.innerHTML = '<span aria-hidden="true">&#215;</span>';
DomEvent.on(closeButton, 'click', this._close, this);
}