diff --git a/django_project/minisass_frontend/src/components/CoordinatesInputForm/degreeInputs.tsx b/django_project/minisass_frontend/src/components/CoordinatesInputForm/degreeInputs.tsx
index 324fc7266..89e326acd 100644
--- a/django_project/minisass_frontend/src/components/CoordinatesInputForm/degreeInputs.tsx
+++ b/django_project/minisass_frontend/src/components/CoordinatesInputForm/degreeInputs.tsx
@@ -34,13 +34,18 @@ function DegreeInput({ label, value, onChange, disabled }: DegreeInputInterface)
);
+ useEffect(() => {
+ if (!isNaN(currValue)) {
+ onChange(currValue)
+ }
+ }, [currValue]);
+
useEffect(() => {
if (!isNaN(value) && disabled) {
- console.log('assigning value ',value)
onChange(value)
setCurrValue(value)
}
- }, [value,currValue]);
+ }, [value]);
return
{
- setLocalLatitude(latitude);
- }, [latitude]);
-
- // Update local longitude state when longitude prop changes
- useEffect(() => {
- setLocalLongitude(longitude);
- }, [longitude]);
-
-
return <>
{
- setLocalLatitude(value); // Update local state
- setLatitude(value); // Update parent state
- }}
- disabled={disabled}
- />
- {
- setLocalLongitude(value);
- setLongitude(value);
- }}
- disabled={disabled}
- />
+ label='Latitude'
+ value={latitude}
+ onChange={setLatitude}
+ disabled={disabled}
+ />
+
>
}
diff --git a/django_project/minisass_frontend/src/components/CoordinatesInputForm/index.tsx b/django_project/minisass_frontend/src/components/CoordinatesInputForm/index.tsx
index f82746b49..0a24860c9 100644
--- a/django_project/minisass_frontend/src/components/CoordinatesInputForm/index.tsx
+++ b/django_project/minisass_frontend/src/components/CoordinatesInputForm/index.tsx
@@ -74,12 +74,13 @@ export default function CoordinatesInputForm(
{selectOnMap ?
(
) :
+ />
+ ) :
type === 'Degree' ?