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.

feat: auto-split pasted lat,lng coordinates in place form — closes #22

Maurice31124a604a01
diff --git a/client/src/components/Planner/PlaceFormModal.tsx b/client/src/components/Planner/PlaceFormModal.tsx
index 6f4896154..ef4ec5f95 100644
--- a/client/src/components/Planner/PlaceFormModal.tsx
+++ b/client/src/components/Planner/PlaceFormModal.tsx
@@ -281,6 +281,15 @@ export default function PlaceFormModal({
step="any"
value={form.lat}
onChange={e => handleChange('lat', e.target.value)}
+ onPaste={e => {
+ const text = e.clipboardData.getData('text').trim()
+ const match = text.match(/^(-?\d+\.?\d*)\s*[,;\s]\s*(-?\d+\.?\d*)$/)
+ if (match) {
+ e.preventDefault()
+ handleChange('lat', match[1])
+ handleChange('lng', match[2])
+ }
+ }}
placeholder={t('places.formLat')}
className="form-input"
/>