forked from MapComplete/MapComplete
A11y: fix tab flow of RasterLayerPicker; see #1181
This commit is contained in:
parent
0cbacd57ec
commit
f5ba4bc3e4
2 changed files with 24 additions and 10 deletions
|
@ -13,7 +13,9 @@
|
|||
import type { RasterLayerPolygon } from "../../Models/RasterLayers"
|
||||
|
||||
export let placedOverMapProperties: MapProperties
|
||||
export let placedOverMap: UIEventSource<MlMap>
|
||||
export let placedOverMap: Store<MlMap>
|
||||
|
||||
export let interactive: boolean = undefined
|
||||
|
||||
export let rasterLayer: UIEventSource<RasterLayerPolygon>
|
||||
|
||||
|
@ -65,4 +67,4 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<MaplibreMap map={altmap} />
|
||||
<MaplibreMap {interactive} map={altmap} />
|
||||
|
|
|
@ -63,30 +63,42 @@
|
|||
})
|
||||
)
|
||||
}
|
||||
function apply() {
|
||||
mapproperties.rasterLayer.setData(rasterLayer.data)
|
||||
dispatch("appliedLayer")
|
||||
}
|
||||
|
||||
function handleKeyPress(e: KeyboardEvent){
|
||||
if(e.key === "Enter"){
|
||||
apply()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if hasLayers}
|
||||
<div class="flex h-full w-full flex-col">
|
||||
<form class="flex h-full w-full flex-col">
|
||||
<button
|
||||
on:click={() => {
|
||||
mapproperties.rasterLayer.setData(rasterLayer.data)
|
||||
dispatch("appliedLayer")
|
||||
}}
|
||||
class="m-0 h-full w-full p-0"
|
||||
tabindex="-1"
|
||||
on:click={() => apply()}
|
||||
class="m-0 h-full w-full p-1 cursor-pointer"
|
||||
>
|
||||
<div class="pointer-events-none w-full h-full">
|
||||
|
||||
<OverlayMap
|
||||
interactive={false}
|
||||
rasterLayer={rasterLayerOnMap}
|
||||
placedOverMap={map}
|
||||
placedOverMapProperties={mapproperties}
|
||||
{visible}
|
||||
/>
|
||||
</div>
|
||||
</button>
|
||||
<select bind:value={$rasterLayer} class="w-full">
|
||||
<select bind:value={$rasterLayer} class="w-full" on:keydown={handleKeyPress}>
|
||||
{#each $availableLayers as availableLayer}
|
||||
<option value={availableLayer}>
|
||||
{availableLayer.properties.name}
|
||||
</option>
|
||||
{/each}
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
{/if}
|
||||
|
|
Loading…
Reference in a new issue