X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a8187ba6c1780cef4de40729cbd3875a9d3dafc4..825ea4fce4ba3568f6105c17e83f4769a9323759:/src/views/run-process-panel/inputs/float-input.tsx

diff --git a/src/views/run-process-panel/inputs/float-input.tsx b/src/views/run-process-panel/inputs/float-input.tsx
index fae8f605..a5905dc5 100644
--- a/src/views/run-process-panel/inputs/float-input.tsx
+++ b/src/views/run-process-panel/inputs/float-input.tsx
@@ -3,6 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
+import { memoize } from 'lodash/fp';
 import { FloatCommandInputParameter, isRequiredInput } from '~/models/workflow';
 import { Field } from 'redux-form';
 import { isNumber } from '~/validators/is-number';
@@ -18,13 +19,17 @@ export const FloatInput = ({ input }: FloatInputProps) =>
         component={Input}
         parse={parseFloat}
         format={format}
-        validate={[
-            isRequiredInput(input)
-                ? isNumber
-                : () => undefined,]} />;
+        validate={getValidation(input)} />;
 
 const format = (value: any) => isNaN(value) ? '' : JSON.stringify(value);
 
+const getValidation = memoize(
+    (input: FloatCommandInputParameter) => ([
+        isRequiredInput(input)
+            ? isNumber
+            : () => undefined,])
+);
+
 const Input = (props: GenericInputProps) =>
     <GenericInput
         component={InputComponent}
