Skip to content

Commit

Permalink
Focus on Layer Menu Item or Link if Remove Button is clicked (#605)
Browse files Browse the repository at this point in the history
* removed timeout before focusing

* Update src/mapml/layers/MapLayer.js

Co-authored-by: Robert Linder <[email protected]>

Co-authored-by: Anshpreet <[email protected]>
Co-authored-by: Robert Linder <[email protected]>
  • Loading branch information
3 people authored Nov 26, 2021
1 parent 4c420e0 commit 1eb82e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mapml/layers/MapLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export var MapMLLayer = L.Layer.extend({
}
mapEl.removeChild(e.target.closest("fieldset").querySelector("span").layer._layerEl);
elem = elem ? root.querySelector(".leaflet-control-attribution").firstElementChild: elem = root.querySelectorAll('input')[fieldset];
setTimeout(() => elem.focus(), 800); // a timeout is set so "pressed remove layer" is announced first
elem.focus();
}, this);

let itemSettingControlButton = L.DomUtil.create('button', 'mapml-layer-item-settings-control', layerItemControls);
Expand Down

0 comments on commit 1eb82e2

Please sign in to comment.