From 54dfa936242679bf6267532fce8f99dfcfbdd9ea Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Wed, 25 Jul 2018 22:03:23 +0200 Subject: [PATCH] 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 --- js/plugin/Sidebar.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/plugin/Sidebar.js b/js/plugin/Sidebar.js index b86dfd8..ec4bbf1 100644 --- a/js/plugin/Sidebar.js +++ b/js/plugin/Sidebar.js @@ -26,6 +26,10 @@ BR.Sidebar = L.Control.Sidebar.extend({ this.on('closing', this._notifyOnClose, this); this.on('toggleExpand', this._notifyOnResize, this); + this.on('closing', function () { + this._map.getContainer().focus(); + }, this); + this._rememberTabState(); if (L.Browser.touch && BR.Browser.touchScreenDetectable && !BR.Browser.touchScreen) {