Skip to content

Commit

Permalink
fix: set quantity to 1 if exceed
Browse files Browse the repository at this point in the history
ref: TAPC-2456

Signed-off-by: Lionel Bueno <[email protected]>
  • Loading branch information
Lionel Bueno committed Jan 9, 2025
1 parent 103150d commit 4353f80
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ODS_SPINNER_SIZE,
OdsInputChangeEvent,
} from '@ovhcloud/ods-components';

import {
OdsButton,
OdsCard,
Expand Down Expand Up @@ -317,7 +318,11 @@ const CreatePlanForm: FC<CreatePlanFormProps> = ({
<OdsQuantity
onOdsChange={(event: OdsInputChangeEvent) => {
const newValue = Number(event.detail.value);
if (newValue >= 1 && newValue <= 1000) onChangeQuantity(newValue);
if (newValue >= 1 && newValue <= 1000) {
onChangeQuantity(newValue);
} else {
onChangeQuantity(1);
}
}}
value={quantity}
min={1}
Expand Down

0 comments on commit 4353f80

Please sign in to comment.