Skip to content

Commit 184a839

Browse files
authored
Merge pull request #6 from tom-konda/improve_a11y
Replace span element with label element to improve A11Y
2 parents c71f5a0 + fde8900 commit 184a839

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

dist/maplibre-gl-opacity.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/maplibre-gl-opacity.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class OpacityControl {
4343
});
4444
});
4545
// レイヤ名追加
46-
const layerName = document.createElement('span');
46+
const layerName = document.createElement('label');
47+
layerName.htmlFor = layerId;
4748
layerName.appendChild(document.createTextNode(this._baseLayersOption[layerId]));
4849
this._container.appendChild(layerName);
4950
}
@@ -67,7 +68,8 @@ class OpacityControl {
6768
}
6869
});
6970
// レイヤ名追加
70-
const layerName = document.createElement('span');
71+
const layerName = document.createElement('label');
72+
layerName.htmlFor = layerId;
7173
layerName.appendChild(document.createTextNode(this._overLayersOption[layerId]));
7274
this._container.appendChild(layerName);
7375
}

0 commit comments

Comments
 (0)