From d3839f2f919a7ab1ff062bdde559097b1fbcce4a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 28 Oct 2021 13:28:43 +0100 Subject: [PATCH] Focus contenteditable node when starting editing a component in the preview --- packages/client/src/components/app/Heading.svelte | 4 ++++ packages/client/src/components/app/Link.svelte | 4 ++++ packages/client/src/components/app/Text.svelte | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/packages/client/src/components/app/Heading.svelte b/packages/client/src/components/app/Heading.svelte index 43ed0a066c..2647b608a5 100644 --- a/packages/client/src/components/app/Heading.svelte +++ b/packages/client/src/components/app/Heading.svelte @@ -13,6 +13,9 @@ export let underline export let size + let node + + $: $component.editing && node?.focus() $: placeholder = $builderStore.inBuilder && !text && !$component.editing $: componentText = getComponentText(text, $builderStore, $component) $: sizeClass = `spectrum-Heading--size${size || "M"}` @@ -55,6 +58,7 @@