Skip to content

Commit 15c02ae

Browse files
committed
Fix empty array input
1 parent 3f6c0d6 commit 15c02ae

File tree

1 file changed

+3
-1
lines changed
  • src/plugins/advanced_settings/public/management_app/components/form

1 file changed

+3
-1
lines changed

src/plugins/advanced_settings/public/management_app/components/form/form.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ export class Form extends PureComponent<FormProps> {
154154
let equalsToDefault = false;
155155
switch (type) {
156156
case 'array':
157-
valueToSave = valueToSave.split(',').map((val: string) => val.trim());
157+
valueToSave = valueToSave.trim();
158+
valueToSave =
159+
valueToSave === '' ? [] : valueToSave.split(',').map((val: string) => val.trim());
158160
equalsToDefault = valueToSave.join(',') === (defVal as string[]).join(',');
159161
break;
160162
case 'json':

0 commit comments

Comments
 (0)