diff --git a/front/public/locales/en/translation.json b/front/public/locales/en/translation.json index 9293a9605e7..6014736f64c 100644 --- a/front/public/locales/en/translation.json +++ b/front/public/locales/en/translation.json @@ -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" diff --git a/front/public/locales/fr/translation.json b/front/public/locales/fr/translation.json index f493d99b1b5..7844413a34e 100644 --- a/front/public/locales/fr/translation.json +++ b/front/public/locales/fr/translation.json @@ -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" diff --git a/front/src/applications/editor/tools/trackSplit/components/TrackSplitLeftPanel.tsx b/front/src/applications/editor/tools/trackSplit/components/TrackSplitLeftPanel.tsx index c97c705fa21..be24e9af806 100644 --- a/front/src/applications/editor/tools/trackSplit/components/TrackSplitLeftPanel.tsx +++ b/front/src/applications/editor/tools/trackSplit/components/TrackSplitLeftPanel.tsx @@ -86,8 +86,8 @@ const TrackSplitLeftPanel: FC = () => { id="offset" type="number" inputProps={{ required: true }} - value={state.offset / 1000} - min={0} + value={state.offset === 0 ? '' : state.offset / 1000} + min={1} max={trackLength} whiteBG focus @@ -100,8 +100,10 @@ const TrackSplitLeftPanel: FC = () => { : undefined } onChange={(e) => { - if (!Number.isNaN(e.target.valueAsNumber)) - setState((prev) => ({ ...prev, offset: e.target.valueAsNumber * 1000 })); + setState((prev) => ({ + ...prev, + offset: e.target.valueAsNumber * 1000 || 0, + })); }} />