Skip to content

Commit

Permalink
react/kiezradar: fix github issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sevfurneaux committed Feb 11, 2025
1 parent 91080e7 commit 1ead2e4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions meinberlin/assets/scss/components_user_facing/_kiezradar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@
margin: 0;
cursor: pointer;

&:focus {
outline: 3px auto Highlight;
outline: 3px auto -webkit-focus-ring-color;
outline-offset: 3px;
}

&::-webkit-slider-thumb {
appearance: none;
width: 1.25rem;
Expand Down
20 changes: 19 additions & 1 deletion meinberlin/react/kiezradar/KiezradarMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import L from 'leaflet'
import React, { useRef } from 'react'
import { createPortal } from 'react-dom'
import django from 'django'
import { Circle, MapContainer, Marker, useMap, ZoomControl } from 'react-leaflet'
import { Circle, MapContainer, Marker, useMap, useMapEvents, ZoomControl } from 'react-leaflet'
import { AddressSearch } from 'adhocracy4'
import ControlWrapper from 'adhocracy4/adhocracy4/maps_react/static/a4maps_react/ControlWrapper'
import MaplibreGlLayer from 'adhocracy4/adhocracy4/maps_react/static/a4maps_react/MaplibreGlLayer'
Expand Down Expand Up @@ -65,6 +65,24 @@ function Radius ({
onChange
}) {
const markerRef = useRef(null)
const isTouchDevice = window.matchMedia('(pointer: coarse)').matches

useMapEvents({
click: (e) => {
if (isTouchDevice) {
onChange({
point: {
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [e.latlng.lng, e.latlng.lat]
}
},
radius
})
}
}
})

const radiusControls = (
<RadiusControls
Expand Down

0 comments on commit 1ead2e4

Please sign in to comment.