From 973bc8ca37d6b45e904154de8195f387a5635aff Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 26 Jan 2021 09:04:29 +0000 Subject: [PATCH] Fix button groups not working in design panel --- .../PropertyControls/PropertyGroup.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyGroup.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyGroup.svelte index d97ee7d18d..9d0bb4a40d 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyGroup.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyGroup.svelte @@ -9,12 +9,17 @@ export let onStyleChanged = () => {} export let open = false + $: style = componentInstance["_styles"][styleCategory] || {} + $: changed = properties.some(prop => hasPropChanged(style, prop)) + const hasPropChanged = (style, prop) => { return style[prop.key] != null && style[prop.key] !== "" } - $: style = componentInstance["_styles"][styleCategory] || {} - $: changed = properties.some(prop => hasPropChanged(style, prop)) + const getControlProps = props => { + const { label, key, control, ...otherProps } = props || {} + return otherProps || {} + } @@ -28,7 +33,7 @@ key={prop.key} value={style[prop.key]} onChange={value => onStyleChanged(styleCategory, prop.key, value)} - props={{ options: prop.options, placeholder: prop.placeholder }} /> + props={getControlProps(prop)} /> {/each} {/if}