From 458b7177b23fe3ee1f785f72ff261d6ba386033d Mon Sep 17 00:00:00 2001 From: Mirodil Date: Tue, 18 Apr 2017 09:12:00 -0400 Subject: [PATCH] Push back keyboard navigation order of L.Popup's close button (#5461) * Web accessibility so tabbing through the page make the link(in the popup) to the first entry focussed before the 'x' for close * remove spaces --- src/layer/Popup.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/layer/Popup.js b/src/layer/Popup.js index 1ae4b40f..aaac9e03 100644 --- a/src/layer/Popup.js +++ b/src/layer/Popup.js @@ -174,14 +174,6 @@ export var Popup = DivOverlay.extend({ prefix + ' ' + (this.options.className || '') + ' leaflet-zoom-animated'); - if (this.options.closeButton) { - var closeButton = this._closeButton = DomUtil.create('a', prefix + '-close-button', container); - closeButton.href = '#close'; - closeButton.innerHTML = '×'; - - DomEvent.on(closeButton, 'click', this._onCloseButtonClick, this); - } - var wrapper = this._wrapper = DomUtil.create('div', prefix + '-content-wrapper', container); this._contentNode = DomUtil.create('div', prefix + '-content', wrapper); @@ -191,6 +183,14 @@ export var Popup = DivOverlay.extend({ this._tipContainer = DomUtil.create('div', prefix + '-tip-container', container); this._tip = DomUtil.create('div', prefix + '-tip', this._tipContainer); + + if (this.options.closeButton) { + var closeButton = this._closeButton = DomUtil.create('a', prefix + '-close-button', container); + closeButton.href = '#close'; + closeButton.innerHTML = '×'; + + DomEvent.on(closeButton, 'click', this._onCloseButtonClick, this); + } }, _updateLayout: function () {