Skip to content

Commit

Permalink
Merge pull request #67 from mit-jp/aesthetic-changes
Browse files Browse the repository at this point in the history
fix bug where user could set decimal places to negative in map editor
  • Loading branch information
ethanrdsch committed Dec 14, 2023
2 parents c47e5ce + be5dcf8 commit 1df784c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/editor/MapOptions.tsx
Expand Up @@ -193,7 +193,7 @@ function MapOptions({ mapVisualization }: { mapVisualization: MapVisualization }
value={mapVisualization.legend_ticks ?? ''}
onChange={(e) => {
let legendTicks: number | undefined = parseInt(e.target.value, 10)
if (Number.isNaN(legendTicks)) {
if (Number.isNaN(legendTicks) || legendTicks < 0) {
legendTicks = undefined
}
updateMap({ ...mapVisualization, legend_ticks: legendTicks })
Expand All @@ -209,7 +209,7 @@ function MapOptions({ mapVisualization }: { mapVisualization: MapVisualization }
value={mapVisualization.legend_decimals ?? mapVisualization.decimals}
onChange={(e) => {
let legendDecimals: number | undefined = parseInt(e.target.value, 10)
if (Number.isNaN(legendDecimals)) {
if (Number.isNaN(legendDecimals) || legendDecimals < 0) {
legendDecimals = undefined
}
updateMap({ ...mapVisualization, legend_decimals: legendDecimals })
Expand Down

0 comments on commit 1df784c

Please sign in to comment.