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:
5
dist/leaflet.css
vendored
5
dist/leaflet.css
vendored
@ -526,13 +526,12 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|||||||
width: 18px;
|
width: 18px;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
font: 16px/14px Tahoma, Verdana, sans-serif;
|
font: 16px/14px Tahoma, Verdana, sans-serif;
|
||||||
color: #c3c3c3;
|
color: #757575;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: bold;
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
.leaflet-container a.leaflet-popup-close-button:hover {
|
.leaflet-container a.leaflet-popup-close-button:hover {
|
||||||
color: #999;
|
color: #585858;
|
||||||
}
|
}
|
||||||
.leaflet-popup-scrolled {
|
.leaflet-popup-scrolled {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
@ -190,8 +190,10 @@ export var Popup = DivOverlay.extend({
|
|||||||
|
|
||||||
if (this.options.closeButton) {
|
if (this.options.closeButton) {
|
||||||
var closeButton = this._closeButton = DomUtil.create('a', prefix + '-close-button', container);
|
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.href = '#close';
|
||||||
closeButton.innerHTML = '×';
|
closeButton.innerHTML = '<span aria-hidden="true">×</span>';
|
||||||
|
|
||||||
DomEvent.on(closeButton, 'click', this._close, this);
|
DomEvent.on(closeButton, 'click', this._close, this);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user