mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-16 16:45:22 +00:00
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:
@ -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 = '×';
|
||||
closeButton.innerHTML = '<span aria-hidden="true">×</span>';
|
||||
|
||||
DomEvent.on(closeButton, 'click', this._close, this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user