Skip to content

Commit

Permalink
adding a condition to block the apply when the fields are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-dkrz committed Feb 6, 2025
1 parent 05d5ee6 commit 18fad9d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/Containers/Databrowser/BBoxSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ function BBoxSelector({ databrowser, router, location }) {

let errorMessage = minLonError || maxLonError || minLatError || maxLatError;

if (!minLon || !maxLon || !minLat || !maxLat) {
errorMessage = "All coordinates are required";
}
if (
!errorMessage &&
minLon &&
Expand Down Expand Up @@ -124,7 +127,7 @@ function BBoxSelector({ databrowser, router, location }) {
);
} else {
applyButton = (
<Button variant="primary" onClick={applyChanges}>
<Button variant="primary" onClick={applyChanges.bind(this)}>
Apply
</Button>
);
Expand Down

0 comments on commit 18fad9d

Please sign in to comment.