UX: improve rendering of disabled GPS button (esp. if not available)

This commit is contained in:
Pieter Vander Vennet 2024-08-09 14:37:57 +02:00
parent 23dae52bad
commit a7c7064636
4 changed files with 7 additions and 4 deletions

View file

@ -208,7 +208,8 @@
let openBackgroundButton: UIEventSource<HTMLElement> = new UIEventSource<HTMLElement>(undefined)
let addNewFeatureMode = state.userRelatedState.addNewFeatureMode
let gpsButtonAriaLabel = state.geolocation.geolocationState.gpsAvailable.map(available => {
let gpsAvailable = state.geolocation.geolocationState.gpsAvailable
let gpsButtonAriaLabel = gpsAvailable.map(available => {
if (!available) {
return Translations.t.general.labels.locationNotAvailable
}
@ -433,6 +434,7 @@
<If condition={featureSwitches.featureSwitchGeolocation}>
<div class="relative m-0">
<MapControlButton
enabled={gpsAvailable}
arialabelDynamic={gpsButtonAriaLabel}
on:click={() => state.geolocationControl.handleClick()}
on:keydown={forwardEventToMap}