Skip to content

Commit

Permalink
Hide X char in popup close button [accessibility] (#11040)
Browse files Browse the repository at this point in the history
Set the attribute aria-hidden to 'true' in popup close button in order to address accessibility as without this attribute, the X character is announced as 'multiplication' or 'times' when accessibility voice over is enabled.
  • Loading branch information
avpeery authored Sep 22, 2021
1 parent 490da08 commit 881bd85
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ui/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ export default class Popup extends Evented {
this._closeButton = DOM.create('button', 'mapboxgl-popup-close-button', this._content);
this._closeButton.type = 'button';
this._closeButton.setAttribute('aria-label', 'Close popup');
this._closeButton.setAttribute('aria-hidden', 'true');
this._closeButton.innerHTML = '×';
this._closeButton.addEventListener('click', this._onClose);
}
Expand Down

0 comments on commit 881bd85

Please sign in to comment.