From a8b44941a067467ecaf2efff43585a5df79e18c3 Mon Sep 17 00:00:00 2001 From: Meier Lukas Date: Sun, 11 Jun 2023 11:59:46 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20pull=20request=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Widgets/Inputs/LocationSelection.tsx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/Dashboard/Tiles/Widgets/Inputs/LocationSelection.tsx b/src/components/Dashboard/Tiles/Widgets/Inputs/LocationSelection.tsx index e79db0d60..008d07c76 100644 --- a/src/components/Dashboard/Tiles/Widgets/Inputs/LocationSelection.tsx +++ b/src/components/Dashboard/Tiles/Widgets/Inputs/LocationSelection.tsx @@ -38,7 +38,7 @@ export const LocationSelection = ({ const [query, setQuery] = useState(value.name ?? ''); const [opened, { open, close }] = useDisclosure(false); const selectionEnabled = query.length > 1; - const EMPTY_LOCATION = t('form.empty'); + const emptyLocation = t('form.empty'); const onCitySelected = (city: City) => { close(); @@ -89,14 +89,14 @@ export const LocationSelection = ({ { - if (typeof v !== 'number') return; + onChange={(inputValue) => { + if (typeof inputValue !== 'number') return; handleChange(key, { ...value, - name: EMPTY_LOCATION, - latitude: v, + name: emptyLocation, + latitude: inputValue, }); - setQuery(EMPTY_LOCATION); + setQuery(emptyLocation); }} precision={5} label={t('form.field.latitude')} @@ -104,14 +104,14 @@ export const LocationSelection = ({ /> { - if (typeof v !== 'number') return; + onChange={(inputValue) => { + if (typeof inputValue !== 'number') return; handleChange(key, { ...value, - name: EMPTY_LOCATION, - longitude: v, + name: emptyLocation, + longitude: inputValue, }); - setQuery(EMPTY_LOCATION); + setQuery(emptyLocation); }} precision={5} label={t('form.field.longitude')}