diff --git a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte index a6608307c3..b9bcf2fa95 100644 --- a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte +++ b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte @@ -41,14 +41,6 @@ const onStyleChanged = store.setComponentStyle - function onPropChanged(key, value) { - if ($store.currentView !== "component") { - store.setPageOrScreenProp(key, value) - return - } - store.setComponentProp(key, value) - } - $: isComponentOrScreen = $store.currentView === "component" || $store.currentFrontEndType === "screen" @@ -103,7 +95,8 @@ {componentDefinition} {panelDefinition} displayNameField={displayName} - onChange={onPropChanged} + onChange={store.setComponentProp} + onScreenPropChange={store.setPageOrScreenProp} screenOrPageInstance={$store.currentView !== 'component' && $store.currentPreviewItem} /> {/if} diff --git a/packages/builder/src/components/userInterface/SettingsView.svelte b/packages/builder/src/components/userInterface/SettingsView.svelte index 159093fe8e..0460e15ad6 100644 --- a/packages/builder/src/components/userInterface/SettingsView.svelte +++ b/packages/builder/src/components/userInterface/SettingsView.svelte @@ -11,6 +11,7 @@ export let componentDefinition = {} export let componentInstance = {} export let onChange = () => {} + export let onScreenPropChange = () => {} export let displayNameField = false export let screenOrPageInstance @@ -91,7 +92,7 @@ label={def.label} key={def.key} value={screenOrPageInstance[def.key]} - {onChange} + onChange={onScreenPropChange} props={{ ...excludeProps(def, ['control', 'label']) }} /> {/each}