Skip to content

Commit 14375f2

Browse files
authored
Enable outlines for features on :focus-visible (keyboard only) (#498)
1 parent 46ce2aa commit 14375f2

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

src/mapml/features/featureRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export var FeatureRenderer = L.SVG.extend({
4343
for (let p of layer._parts) {
4444
if (p.rings){
4545
this._createPath(p, layer.options.className, layer.featureAttributes['aria-label'], layer.options.interactive, layer.featureAttributes);
46-
if(layer.outlinePath) p.path.style.stroke = "none";
46+
//if(layer.outlinePath) p.path.style.stroke = "none";
4747
}
4848
if (p.subrings) {
4949
for (let r of p.subrings) {

src/mapml/layers/FeatureLayer.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,28 @@ export var MapMLFeatures = L.FeatureGroup.extend({
1717
style.innerHTML = `
1818
g[role="link"]:focus,
1919
g[role="link"]:hover,
20-
g[role="button"]:focus,
21-
g[role="button"]:hover,
20+
g[role="link"]:focus path,
21+
g[role="link"]:hover path,
2222
g[role="link"] path:focus,
2323
g[role="link"] path:hover,
24+
g[role="button"]:focus,
25+
g[role="button"]:hover,
26+
g[role="button"]:focus path,
27+
g[role="button"]:hover path,
2428
g[role="button"] path:focus,
2529
g[role="button"] path:hover,
26-
g[role="link"]:focus path,
27-
g[role="link"]:hover path,
28-
g[role="button"]:focus path,
29-
g[role="button"]:hover path {
30-
outline: 0!important;
30+
path[tabindex="0"]:focus {
3131
stroke: #0000EE;
3232
stroke: LinkText;
33+
}
34+
g[role="link"]:focus:not(:focus-visible),
35+
g[role="link"]:focus:not(:focus-visible) path,
36+
g[role="link"] path:focus:not(:focus-visible),
37+
g[role="button"]:focus:not(:focus-visible),
38+
g[role="button"]:focus:not(:focus-visible) path,
39+
g[role="button"] path:focus:not(:focus-visible),
40+
path[tabindex="0"]:focus:not(:focus-visible) {
41+
outline: 0!important;
3342
}`;
3443
}
3544

0 commit comments

Comments
 (0)