Focus map after sidebar close (#114)

to be consistent with Leaflet Controls and EasyButton behaviour; 
removes focus outline in Firefox from tab that would else remain there
This commit is contained in:
Norbert Renner 2018-07-25 22:03:23 +02:00
parent 607659317f
commit 54dfa93624

View file

@ -26,6 +26,10 @@ BR.Sidebar = L.Control.Sidebar.extend({
this.on('closing', this._notifyOnClose, this); this.on('closing', this._notifyOnClose, this);
this.on('toggleExpand', this._notifyOnResize, this); this.on('toggleExpand', this._notifyOnResize, this);
this.on('closing', function () {
this._map.getContainer().focus();
}, this);
this._rememberTabState(); this._rememberTabState();
if (L.Browser.touch && BR.Browser.touchScreenDetectable && !BR.Browser.touchScreen) { if (L.Browser.touch && BR.Browser.touchScreenDetectable && !BR.Browser.touchScreen) {