Skip to content

Commit

Permalink
Make esc key return focus to leaflet container
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-lu-uw committed Dec 21, 2021
1 parent e85ab92 commit 86c860c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mapml/features/featureGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export var FeatureGroup = L.FeatureGroup.extend({
} else if (!([9, 16, 13, 27, 49, 50, 51, 52, 53, 54, 55].includes(e.keyCode))){
this._map.featureIndex.currentIndex = 0;
this._map.featureIndex.inBoundFeatures[0].path.focus();
} else if(e.keyCode === 27){
this._map.featureIndex.currentIndex = 0;
this._map._container.focus();
}

if(e.target.tagName.toUpperCase() !== "G") return;
Expand Down

0 comments on commit 86c860c

Please sign in to comment.