diff --git a/packages/client/src/components/Component.svelte b/packages/client/src/components/Component.svelte index b65d7b0cdc..9c8aada1bc 100644 --- a/packages/client/src/components/Component.svelte +++ b/packages/client/src/components/Component.svelte @@ -201,7 +201,7 @@ // Metadata to pass into grid action to apply CSS const checkGrid = x => - x?._component.endsWith("/container") && x?.layout === "grid" + x?._component?.endsWith("/container") && x?.layout === "grid" $: insideGrid = checkGrid(parent) $: isGrid = checkGrid(instance) $: gridMetadata = { diff --git a/packages/client/src/components/Screen.svelte b/packages/client/src/components/Screen.svelte index 2d62b2f810..bf91a3a6df 100644 --- a/packages/client/src/components/Screen.svelte +++ b/packages/client/src/components/Screen.svelte @@ -14,7 +14,6 @@ // Get the screen definition for the current route $: screen = $screenStore.activeScreen - $: screenDefinition = { ...screen?.props, addEmptyRows: true } $: onLoadActions.set(screen?.onLoad) $: runOnLoadActions($onLoadActions, params) @@ -42,10 +41,10 @@ -{#if $routeStore.routerLoaded} - {#key screenDefinition?._id} +{#if $routeStore.routerLoaded && screen?.props} + {#key screen.props._id} - + {/key} {/if} diff --git a/packages/client/src/components/app/container/GridContainer.svelte b/packages/client/src/components/app/container/GridContainer.svelte index bbcdbbf689..4dc75f3513 100644 --- a/packages/client/src/components/app/container/GridContainer.svelte +++ b/packages/client/src/components/app/container/GridContainer.svelte @@ -4,8 +4,6 @@ import { GridRowHeight, GridColumns } from "constants" import { memo } from "@budibase/frontend-core" - export let addEmptyRows = false - const component = getContext("component") const { styleable, builderStore } = getContext("sdk") const context = getContext("context") @@ -18,11 +16,8 @@ let styles = memo({}) $: inBuilder = $builderStore.inBuilder - $: requiredRows = calculateRequiredRows( - $children, - mobile, - addEmptyRows && inBuilder - ) + $: addEmptyRows = $component.isRoot && inBuilder + $: requiredRows = calculateRequiredRows($children, mobile, addEmptyRows) $: requiredHeight = requiredRows * GridRowHeight $: availableRows = Math.floor(height / GridRowHeight) $: rows = Math.max(requiredRows, availableRows)