From 61249623faa6cb515f75a0ec71b367e0c1101f10 Mon Sep 17 00:00:00 2001 From: Dominic Burger Date: Tue, 30 Jan 2024 16:00:11 +0100 Subject: [PATCH] Only mark coords as dirty when clicking on map --- src/ClientApp/src/components/BohrungForm.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ClientApp/src/components/BohrungForm.js b/src/ClientApp/src/components/BohrungForm.js index 487ebc9..b480f77 100644 --- a/src/ClientApp/src/components/BohrungForm.js +++ b/src/ClientApp/src/components/BohrungForm.js @@ -94,8 +94,9 @@ export default function BohrungForm(props) { if (currentBohrung?.geometrie?.coordinates) { const x = currentBohrung.geometrie.coordinates[0]; const y = currentBohrung.geometrie.coordinates[1]; - setValue("x_coordinate", x.toFixed(1), { shouldDirty: true }); - setValue("y_coordinate", y.toFixed(1), { shouldDirty: true }); + const changedFromMapClick = currentBohrung.coordinatesChanged; + setValue("x_coordinate", x.toFixed(1), { shouldDirty: changedFromMapClick }); + setValue("y_coordinate", y.toFixed(1), { shouldDirty: changedFromMapClick }); currentBohrung.coordinatesChanged = false; } }, [currentBohrung, setValue]);