Skip to content

Commit

Permalink
fix: enum empty value smart controls
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Aug 9, 2020
1 parent b3f1302 commit 6ed559b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/core/src/controls-smart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,16 @@ export const controlFromProps = (
const options = Array.isArray(propDef.type)
? propDef.type
: (propDef.type as any).value || splitType;

if (!Array.isArray(options)) {
return null;
}

return {
type: ControlTypes.OPTIONS,
options: options.map((v: any) => cleanQuotes(v.value ? v.value : v)),
options: options.map((v: any) => {
return cleanQuotes(v.value ?? v);
}),
value,
};
}
Expand Down

0 comments on commit 6ed559b

Please sign in to comment.