diff --git a/core/core/src/controls-smart.ts b/core/core/src/controls-smart.ts index 22ff742ac..c95b4becc 100644 --- a/core/core/src/controls-smart.ts +++ b/core/core/src/controls-smart.ts @@ -144,10 +144,16 @@ interface NamedComponentControl { } export const controlsFromProps = (props: PropTypes): ComponentControls => { return Object.keys(props) - .map((key: string) => ({ - name: key, - control: controlFromProps(key, props[key]), - })) + .map((key: string) => { + const control = controlFromProps(key, props[key]); + if (control) { + control.defaultValue = control.value; + } + return { + name: key, + control, + }; + }) .filter(p => p.control) .reduce( (acc: ComponentControls, prop: NamedComponentControl) => ({ diff --git a/ui/blocks/src/PropsTable/BasePropsTable.tsx b/ui/blocks/src/PropsTable/BasePropsTable.tsx index 6a994b04c..91a9d8641 100644 --- a/ui/blocks/src/PropsTable/BasePropsTable.tsx +++ b/ui/blocks/src/PropsTable/BasePropsTable.tsx @@ -331,7 +331,6 @@ export const BasePropsTable: FC = ({ value: any, ) => { setControlValue(value); - console.log(storyId, propertyName, value); }, }), );