From eb4206cc55f6fbcbd660941c326a47d96aad7ef7 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 6 Apr 2022 17:31:59 +0100 Subject: [PATCH] Move settings bar below element if at very top --- packages/client/src/components/preview/SettingsBar.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/client/src/components/preview/SettingsBar.svelte b/packages/client/src/components/preview/SettingsBar.svelte index c5ad8bef6c..05df1ef898 100644 --- a/packages/client/src/components/preview/SettingsBar.svelte +++ b/packages/client/src/components/preview/SettingsBar.svelte @@ -66,6 +66,11 @@ newTop = deviceBottom - 44 } + //If element is at the very top of the screen, put the bar below the element + if (elBounds.top < elBounds.height) { + newTop = elBounds.bottom + verticalOffset + } + // Horizontally, try to center first. // Failing that, render to left edge of component. // Failing that, render to right edge of component,