Skip to content

Commit

Permalink
Merge pull request #327 from GeoWerkstatt/bohrung-save-button
Browse files Browse the repository at this point in the history
Only mark coords as dirty when clicking on map
  • Loading branch information
domi-b authored Jan 30, 2024
2 parents cdf26cb + 6124962 commit 5d431d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ClientApp/src/components/BohrungForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 5d431d3

Please sign in to comment.