diff --git a/apps/map/components/map/suggest-form.tsx b/apps/map/components/map/suggest-form.tsx index 344cd9f683..83529daf83 100644 --- a/apps/map/components/map/suggest-form.tsx +++ b/apps/map/components/map/suggest-form.tsx @@ -18,6 +18,11 @@ type formProps = { export function SuggestMapFormSheet({ latitude, longitude }: formProps) { const [isOpen, setIsOpen] = useState(false) + const [coordinates, setCoordinates] = useState({ + latitude: latitude, + longitude: longitude, + }) + const [state, formAction] = useFormState< { error: boolean @@ -72,19 +77,28 @@ export function SuggestMapFormSheet({ latitude, longitude }: formProps) { required={true} label="Latitude" id="latitude" - value={latitude} + value={coordinates.latitude} placeholder="Latitude" name="latitude" type="number" + onChange={(e) => { + setCoordinates({ ...coordinates, latitude: parseFloat(e.target.value) }) + }} /> { + setCoordinates({ + ...coordinates, + longitude: parseFloat(e.target.value), + }) + }} /> {state.error && {state.message}}