Skip to content

Commit

Permalink
Fix empty array input
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Sep 28, 2020
1 parent 3f6c0d6 commit 15c02ae
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ export class Form extends PureComponent<FormProps> {
let equalsToDefault = false;
switch (type) {
case 'array':
valueToSave = valueToSave.split(',').map((val: string) => val.trim());
valueToSave = valueToSave.trim();
valueToSave =
valueToSave === '' ? [] : valueToSave.split(',').map((val: string) => val.trim());
equalsToDefault = valueToSave.join(',') === (defVal as string[]).join(',');
break;
case 'json':
Expand Down

0 comments on commit 15c02ae

Please sign in to comment.