diff --git a/frontend/src/component/feature/StrategyTypes/StrategyParameter/StrategyParameter.tsx b/frontend/src/component/feature/StrategyTypes/StrategyParameter/StrategyParameter.tsx index 318c7f6cef..23c918109b 100644 --- a/frontend/src/component/feature/StrategyTypes/StrategyParameter/StrategyParameter.tsx +++ b/frontend/src/component/feature/StrategyTypes/StrategyParameter/StrategyParameter.tsx @@ -38,6 +38,10 @@ export const StrategyParameter = ({ updateParameter(name, event.target.value); }; + const onChangeString = (event: React.ChangeEvent) => { + updateParameter(name, parseParameterString(event.target.value)); + }; + const onChangePercentage = (event: Event, next: number | number[]) => { updateParameter(name, next.toString()); }; @@ -46,6 +50,10 @@ export const StrategyParameter = ({ updateParameter(name, String(checked)); }; + const onSetListConfig = (field: string, value: string) => { + updateParameter(field, parseParameterStrings(value).join(',')); + }; + if (type === 'percentage') { return (
@@ -69,7 +77,7 @@ export const StrategyParameter = ({ name={name} list={parseParameterStrings(parameters[name])} disabled={!editable} - setConfig={updateParameter} + setConfig={onSetListConfig} errors={errors} /> @@ -131,7 +139,7 @@ export const StrategyParameter = ({ helperText={error} name={name} label={label} - onChange={onChange} + onChange={onChangeString} value={parseParameterString(parameters[name])} />