diff --git a/packages/client/src/components/app/Layout.svelte b/packages/client/src/components/app/Layout.svelte index fccdef7dcc..d7517b06b8 100644 --- a/packages/client/src/components/app/Layout.svelte +++ b/packages/client/src/components/app/Layout.svelte @@ -38,6 +38,8 @@ "Extra small": "xs", } + let mobileOpen = false + // Set some layout context. This isn't used in bindings but can be used // determine things about the current app layout. $: mobile = $context.device.mobile @@ -58,7 +60,25 @@ $context.device.width, $context.device.height ) - let mobileOpen = false + + // Scroll navigation into view if selected + $: { + if ( + $builderStore.inBuilder && + $builderStore.selectedComponentId === "navigation" + ) { + const node = document.getElementsByClassName("nav-wrapper")?.[0] + if (node) { + console.log("scroll") + node.style.scrollMargin = "100px" + node.scrollIntoView({ + behavior: "smooth", + block: "start", + inline: "start", + }) + } + } + } const isInternal = url => { return url.startsWith("/") @@ -111,76 +131,85 @@ > {#if typeClass !== "none"}