From 9bcc416f58f0d1bd7e7d75e3e7c5fbbd0eeab191 Mon Sep 17 00:00:00 2001 From: atanasster Date: Sat, 15 May 2021 19:22:16 +0300 Subject: [PATCH] fix: props enum undefined to control --- core/core/src/controls-randomize.ts | 2 +- core/core/src/controls-smart.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/core/src/controls-randomize.ts b/core/core/src/controls-randomize.ts index 092001dea..d385cee5d 100644 --- a/core/core/src/controls-randomize.ts +++ b/core/core/src/controls-randomize.ts @@ -197,7 +197,7 @@ export const randomizeData = (controls: ComponentControls): RandomizedData => { } return { name, - value: value === 'undefined' ? undefined : value, + value, }; } default: diff --git a/core/core/src/controls-smart.ts b/core/core/src/controls-smart.ts index 3a2188b9c..778604a1e 100644 --- a/core/core/src/controls-smart.ts +++ b/core/core/src/controls-smart.ts @@ -110,7 +110,8 @@ export const controlFromProps = ( return { type: ControlTypes.OPTIONS, options: options.map((v: any) => { - return cleanQuotes(v.value ?? v); + const option = cleanQuotes(v.value ?? v); + return option === 'undefined' ? undefined : option; }), value, };