Merge pull request #3275 from Jakobud/bug/keyboard-event-prevent-map-refocus

Prevent map refocus if control click event is from the keyboard
This commit is contained in:
Vladimir Agafonkin 2015-03-05 18:48:15 +02:00
commit bba39b3eba

View File

@ -71,8 +71,9 @@ L.Control = L.Class.extend({
return this; return this;
}, },
_refocusOnMap: function () { _refocusOnMap: function (e) {
if (this._map) { // if map exists and event is not a keyboard event
if (this._map && e && e.screenX > 0 && e.screenY > 0) {
this._map.getContainer().focus(); this._map.getContainer().focus();
} }
} }