From 0875d0c5e1aebef226d8285a8fa82597aacc811f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 13 Aug 2024 09:52:10 +0100 Subject: [PATCH] Only show empty rows in grid layouts when in the builder --- .../src/components/app/container/GridContainer.svelte | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/app/container/GridContainer.svelte b/packages/client/src/components/app/container/GridContainer.svelte index 3c56f9517c..f332e197c3 100644 --- a/packages/client/src/components/app/container/GridContainer.svelte +++ b/packages/client/src/components/app/container/GridContainer.svelte @@ -17,7 +17,12 @@ let mounted = false let styles = memo({}) - $: requiredRows = calculateRequiredRows($children, mobile, addEmptyRows) + $: inBuilder = $builderStore.inBuilder + $: requiredRows = calculateRequiredRows( + $children, + mobile, + addEmptyRows && inBuilder + ) $: requiredHeight = requiredRows * GridRowHeight $: availableRows = Math.floor(height / GridRowHeight) $: rows = Math.max(requiredRows, availableRows) @@ -133,7 +138,7 @@ data-cols={GridColumns} data-col-size={colSize} > - {#if $builderStore.inBuilder} + {#if inBuilder}
{#each { length: GridColumns * rows } as _, idx}