Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix: keep marker tooltip visible on touch devices when selected

Mauricefb2e8d8209fa
diff --git a/client/src/components/Map/MapView.tsx b/client/src/components/Map/MapView.tsx
index 5d6b7e749..2a89f6a35 100644
--- a/client/src/components/Map/MapView.tsx
+++ b/client/src/components/Map/MapView.tsx
@@ -422,6 +422,8 @@ export const MapView = memo(function MapView({
})
}, [])
+ const isTouchDevice = typeof window !== 'undefined' && ('ontouchstart' in window || navigator.maxTouchPoints > 0)
+
const markers = useMemo(() => places.map((place) => {
const isSelected = place.id === selectedPlaceId
const cacheKey = place.google_place_id || place.osm_id || `${place.lat},${place.lng}`
@@ -444,6 +446,7 @@ export const MapView = memo(function MapView({
offset={[0, 0]}
opacity={1}
className="map-tooltip"
+ permanent={isTouchDevice && isSelected}
>
<div style={{ fontFamily: "-apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif" }}>
<div style={{ fontWeight: 600, fontSize: 12, color: 'var(--text-primary)', whiteSpace: 'nowrap' }}>
@@ -467,7 +470,7 @@ export const MapView = memo(function MapView({
</Tooltip>
</Marker>
)
- }), [places, selectedPlaceId, dayOrderMap, photoUrls, onMarkerClick])
+ }), [places, selectedPlaceId, dayOrderMap, photoUrls, onMarkerClick, isTouchDevice])
return (
<MapContainer