Skip to content

Commit 64ab695

Browse files
authored
Fix time <select> (#492)
1 parent 80a4a4e commit 64ab695

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/mapml.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@
395395
.leaflet-tooltip,
396396
.leaflet-crosshair *,
397397
.mapml-contextmenu-item > *,
398-
.mapml-control-layers label[for^="o"],
398+
.mapml-control-layers .mapml-control-layers summary label,
399399
.mapml-draggable [aria-grabbed="true"] .mapml-control-layers > * {
400400
pointer-events: none!important;
401401
}

src/mapml/layers/MapLayer.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ export var MapMLLayer = L.Layer.extend({
543543
fieldset.setAttribute("aria-grabbed", "false");
544544

545545
fieldset.onmousedown = (downEvent) => {
546-
if(downEvent.target.tagName.toLowerCase() === "input") return;
546+
if(downEvent.target.tagName.toLowerCase() === "input" || downEvent.target.tagName.toLowerCase() === "select") return;
547547
downEvent.preventDefault();
548548
let control = fieldset,
549549
controls = fieldset.parentNode,
@@ -630,9 +630,8 @@ export var MapMLLayer = L.Layer.extend({
630630
id = '#'+mapmlInput.getAttribute('id');
631631
// don't add it again if it is referenced > once
632632
if (mapmlInput.tagName.toLowerCase() === 'select' && !frag.querySelector(id)) {
633-
// generate a <details><summary></summary><input...></details>
634-
var userfieldset = document.createElement('fieldset'),
635-
selectdetails = document.createElement('details'),
633+
// generate a <details><summary></summary><select...></details>
634+
var selectdetails = document.createElement('details'),
636635
selectsummary = document.createElement('summary'),
637636
selectSummaryLabel = document.createElement('label');
638637
selectSummaryLabel.innerText = mapmlInput.getAttribute('name');
@@ -641,8 +640,7 @@ export var MapMLLayer = L.Layer.extend({
641640
selectsummary.appendChild(selectSummaryLabel);
642641
selectdetails.appendChild(selectsummary);
643642
selectdetails.appendChild(mapmlInput.htmlselect);
644-
userfieldset.appendChild(selectdetails);
645-
frag.appendChild(userfieldset);
643+
frag.appendChild(selectdetails);
646644
}
647645
}
648646
}

0 commit comments

Comments
 (0)