From: Michal Klobukowski Date: Thu, 27 Dec 2018 09:41:42 +0000 (+0100) Subject: Fix IntInput zero or empty string parsing X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/2c2a877d45ed33ba2c529c6996ccd79b0447a554 Fix IntInput zero or empty string parsing Feature #master Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- diff --git a/src/views/run-process-panel/inputs/int-input.tsx b/src/views/run-process-panel/inputs/int-input.tsx index 32ebeb75c2..78f0d736d1 100644 --- a/src/views/run-process-panel/inputs/int-input.tsx +++ b/src/views/run-process-panel/inputs/int-input.tsx @@ -22,7 +22,7 @@ export const IntInput = ({ input }: IntInputProps) => format={format} validate={getValidation(input)} />; -const parse = (value: any) => parseInt(value, 10); +const parse = (value: any) => value === '' ? '' : parseInt(value, 10); const format = (value: any) => isNaN(value) ? '' : JSON.stringify(value);