diff --git a/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte index 0c542fddd4..14e4f74bcb 100644 --- a/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/ComponentSettingsSection.svelte @@ -93,10 +93,11 @@ control={getComponentForSettingType(setting.type)} label={setting.label} key={setting.key} - value={componentInstance[setting.key] ?? - componentDefinition[setting.key]?.defaultValue} + value={componentInstance[setting.key]} + defaultValue={setting.defaultValue} nested={setting.nested} onChange={val => updateProp(setting.key, val)} + highlighted={$store.highlightedSettingKey === setting.key} props={{ options: setting.options || [], placeholder: setting.placeholder || null, @@ -107,9 +108,6 @@ {componentBindings} {componentInstance} {componentDefinition} - highlighted={$store.highlightedSettingKey === setting.key && - (componentInstance[setting.key] == null || - componentInstance[setting.key] === "")} /> {/if} {/each} diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte index ef68af3fd9..3927e0b3a5 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte @@ -13,6 +13,7 @@ export let key = "" export let type = "" export let value = null + export let defaultValue = null export let props = {} export let onChange = () => {} export let bindings = [] @@ -20,8 +21,9 @@ export let nested = false export let highlighted = false + $: nullishValue = value == null || value === "" $: allBindings = getAllBindings(bindings, componentBindings, nested) - $: safeValue = getSafeValue(value, props.defaultValue, allBindings) + $: safeValue = getSafeValue(value, defaultValue, allBindings) $: tempValue = safeValue $: replaceBindings = val => readableToRuntimeBinding(allBindings, val) @@ -71,7 +73,11 @@ }) -