Skip to content

Commit

Permalink
front: change minimum input to 1, update translation json and change …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
theocrsb committed Jul 1, 2024
1 parent f70017a commit 24fc243
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion front/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
"offset": {
"label": "Position",
"description": "Offset of the point in meters to the beginning of the track section",
"error": "The offset of the split point to the beginning must be greater than 0 and smaller than {{max}}"
"error": "The offset of the split point to the beginning must be greater than 1 and smaller than {{max}}"
},
"actions": {
"save": "Save the split"
Expand Down
2 changes: 1 addition & 1 deletion front/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
"offset": {
"label": "Position",
"description": "Distance entre le point et le début du TIV (en mètres)",
"error": "La position doit être un nombre compris entre 0 et {{max}}"
"error": "La position doit être un nombre compris entre 1 et {{max}}"
},
"actions": {
"save": "Sauvegarder la division"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const TrackSplitLeftPanel: FC<unknown> = () => {
type="number"
inputProps={{ required: true }}
value={state.offset === 0 ? '' : state.offset / 1000}
min={0}
min={1}
max={trackLength}
whiteBG
focus
Expand All @@ -102,7 +102,7 @@ const TrackSplitLeftPanel: FC<unknown> = () => {
onChange={(e) => {
setState((prev) => ({
...prev,
offset: (!Number.isNaN(e.target.valueAsNumber) ? e.target.valueAsNumber : 0) * 1000,
offset: e.target.valueAsNumber * 1000 || 0,
}));
}}
/>
Expand Down

0 comments on commit 24fc243

Please sign in to comment.