X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7a2f0082071947bfec27ed4f2a16250e1d611d21..32e3370febf2e29c45e27065cdc14a883775f261:/src/views/run-process-panel/inputs/string-input.tsx

diff --git a/src/views/run-process-panel/inputs/string-input.tsx b/src/views/run-process-panel/inputs/string-input.tsx
index f6b50a7c47..7fc74315e9 100644
--- a/src/views/run-process-panel/inputs/string-input.tsx
+++ b/src/views/run-process-panel/inputs/string-input.tsx
@@ -3,6 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
+import { memoize } from 'lodash/fp';
 import { isRequiredInput, StringCommandInputParameter } from '~/models/workflow';
 import { Field } from 'redux-form';
 import { require } from '~/validators/require';
@@ -17,11 +18,14 @@ export const StringInput = ({ input }: StringInputProps) =>
         name={input.id}
         commandInput={input}
         component={StringInputComponent}
-        validate={[
-            isRequiredInput(input)
-                ? require
-                : () => undefined,
-        ]} />;
+        validate={getValidation(input)} />;
+
+const getValidation = memoize(
+    (input: StringCommandInputParameter) => ([
+        isRequiredInput(input)
+            ? require
+            : () => undefined,
+    ]));
 
 const StringInputComponent = (props: GenericInputProps) =>
     <GenericInput
