diff --git a/packages/client/src/components/app/Button.svelte b/packages/client/src/components/app/Button.svelte index 018f21c583..a10b992561 100644 --- a/packages/client/src/components/app/Button.svelte +++ b/packages/client/src/components/app/Button.svelte @@ -4,6 +4,7 @@ const { styleable, builderStore } = getContext("sdk") const component = getContext("component") + const containerClickableStore = getContext("containerClickable") export let disabled = false export let text = "" @@ -18,6 +19,10 @@ let node + containerClickableStore.subscribe(hasOnClick => { + disabled = hasOnClick + }) + $: $component.editing && node?.focus() $: componentText = getComponentText(text, $builderStore, $component) diff --git a/packages/client/src/components/app/Container.svelte b/packages/client/src/components/app/Container.svelte index a5c8ce6d4d..e8e757bc3e 100644 --- a/packages/client/src/components/app/Container.svelte +++ b/packages/client/src/components/app/Container.svelte @@ -1,9 +1,13 @@
{ + if (actions && actions.length === 0) { + return null + } + // Prevent button actions in the builder preview if (!actions || get(builderStore).inBuilder) { return () => {}