forked from MapComplete/MapComplete
UX: improve rendering of disabled GPS button (esp. if not available)
This commit is contained in:
parent
ebb8f96961
commit
b29557a21d
4 changed files with 7 additions and 4 deletions
|
|
@ -27,6 +27,7 @@
|
|||
on:click={(e) => dispatch("click", e)}
|
||||
on:keydown
|
||||
use:ariaLabelStore={arialabelString}
|
||||
disabled={!$enabled}
|
||||
class={twJoin(
|
||||
"pointer-events-auto relative h-fit w-fit rounded-full",
|
||||
cls,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -429,6 +430,7 @@
|
|||
<If condition={featureSwitches.featureSwitchGeolocation}>
|
||||
<div class="relative m-0">
|
||||
<MapControlButton
|
||||
enabled={gpsAvailable}
|
||||
arialabelDynamic={gpsButtonAriaLabel}
|
||||
on:click={() => state.geolocationControl.handleClick()}
|
||||
on:keydown={forwardEventToMap}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue