Skip to content

Commit

Permalink
fix(coordsToFloats): convert inline edit coord iputs to floats
Browse files Browse the repository at this point in the history
  • Loading branch information
antekai committed Oct 17, 2018
1 parent a47db23 commit 49c4a76
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Map/Screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,17 @@ class MapScreen extends React.Component {
};
onEnterLat = (id, e) => {
console.log(id, e.target.value);
const lat = parseFloat(e.target.value);
const clonedData = [...this.state.data];
const updatedRecord = { ...clonedData[id], lat: e.target.value };
const updatedRecord = { ...clonedData[id], lat: lat };
clonedData[id] = updatedRecord;
this.setState({ data: clonedData });
};
onEnterLon = (id, e) => {
console.log(id, e.target.value);
const lng = parseFloat(e.target.value);
const clonedData = [...this.state.data];
const updatedRecord = { ...clonedData[id], lon: e.target.value };
const updatedRecord = { ...clonedData[id], lon: lng };
clonedData[id] = updatedRecord;
this.setState({ data: clonedData });
};
Expand Down

0 comments on commit 49c4a76

Please sign in to comment.