From b343d7edbd553b3bf76ac0cfdcd8abe22c338bb3 Mon Sep 17 00:00:00 2001 From: SanjalKatiyar Date: Wed, 14 Aug 2024 16:02:44 +0530 Subject: [PATCH] Fix custom storage quota (value input) --- packages/shared/src/utils/RequestSizeInput.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/shared/src/utils/RequestSizeInput.tsx b/packages/shared/src/utils/RequestSizeInput.tsx index b90a78a38..5bd20c1bf 100644 --- a/packages/shared/src/utils/RequestSizeInput.tsx +++ b/packages/shared/src/utils/RequestSizeInput.tsx @@ -53,7 +53,7 @@ export const RequestSizeInput: React.FC = ({ testID, unitText, }) => { - const parsedRequestSizeValue = parseInt(defaultRequestSizeValue, 10); + const parsedRequestSizeValue = parseInt(String(defaultRequestSizeValue), 10); const defaultValue = Number.isFinite(parsedRequestSizeValue) ? parsedRequestSizeValue : null; @@ -62,7 +62,7 @@ export const RequestSizeInput: React.FC = ({ const onValueChange: React.ReactEventHandler = (event) => { setValue(parseInt(event.currentTarget.value, 10)); - onChange({ value: event.currentTarget.value, unit }); + onChange({ value: parseInt(event.currentTarget.value, 10), unit }); }; const changeValueBy = (changeBy: number) => { @@ -121,7 +121,7 @@ export type RequestSizeInputProps = { required?: boolean; dropdownUnits: any; defaultRequestSizeUnit: string; - defaultRequestSizeValue: string; + defaultRequestSizeValue: string | number; describedBy?: string; step?: number; minValue?: number;