From f6a18ca5501b04d2a33dcbc515228130e1f21f1d Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 6 Oct 2021 13:33:37 +0100 Subject: [PATCH 1/2] Fix padding being added to empty layouts in mobile view --- packages/client/src/components/app/Layout.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/app/Layout.svelte b/packages/client/src/components/app/Layout.svelte index 9a7ce13220..0ffbbf7ab1 100644 --- a/packages/client/src/components/app/Layout.svelte +++ b/packages/client/src/components/app/Layout.svelte @@ -353,7 +353,7 @@ } /* Reduce padding */ - .mobile .main { + .mobile:not(.layout--none) .main { padding: 16px; } From fe35d08422431ef132e84d068dfdc09e063486b5 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 6 Oct 2021 13:59:25 +0100 Subject: [PATCH 2/2] Fix drag and drop indicator positioning when not using desktop preview --- .../components/preview/DNDPositionIndicator.svelte | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/client/src/components/preview/DNDPositionIndicator.svelte b/packages/client/src/components/preview/DNDPositionIndicator.svelte index e849ab0313..011b386282 100644 --- a/packages/client/src/components/preview/DNDPositionIndicator.svelte +++ b/packages/client/src/components/preview/DNDPositionIndicator.svelte @@ -17,7 +17,17 @@ if (!bounds || !side) { return null } - const { left, top, width, height } = bounds + + // Get preview offset + const root = document.getElementById("clip-root") + const rootBounds = root.getBoundingClientRect() + + // Subtract preview offset from bounds + let { left, top, width, height } = bounds + left -= rootBounds.left + top -= rootBounds.top + + // Determine position if (side === Sides.Top || side === Sides.Bottom) { return { top: side === Sides.Top ? top - 4 : top + height,