From 2d45ad1929377431f134ff5e62246814e1e1d696 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 7 Sep 2022 15:22:41 +0200 Subject: [PATCH 1/7] fix: page scrolling when menu open --- src/lib/layout/shell.svelte | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/lib/layout/shell.svelte b/src/lib/layout/shell.svelte index 98d62d6bf..b0a782cd3 100644 --- a/src/lib/layout/shell.svelte +++ b/src/lib/layout/shell.svelte @@ -13,10 +13,12 @@ } from '$lib/stores/organization'; import { sdkForConsole } from '$lib/stores/sdk'; import { base } from '$app/paths'; + import { browser } from '$app/env'; export let isOpen = false; export let showSideNavigation = false; + let y: number; let tabsList: HTMLUListElement; let showLeft = false; let showRight = false; @@ -77,9 +79,21 @@ } }; }; + + const toggleMenu = () => { + y = 0; + isOpen = !isOpen; + if (browser) { + if (isOpen) { + document.body.classList.add('u-overflow-hidden'); + } else { + document.body.classList.remove('u-overflow-hidden'); + } + } + }; - +
From 5d43f42aed57ded224802b33f0d4a52c2c7ac585 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 7 Sep 2022 16:14:35 +0200 Subject: [PATCH 2/7] feat: errors scroll into view --- src/lib/components/modal.svelte | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/lib/components/modal.svelte b/src/lib/components/modal.svelte index 05da1e24f..8a85e526b 100644 --- a/src/lib/components/modal.svelte +++ b/src/lib/components/modal.svelte @@ -10,6 +10,7 @@ export let error: string = null; export let closable = true; + let alert: HTMLElement; const dispatch = createEventDispatcher(); const transitionFly: FlyParams = { duration: 150, @@ -48,6 +49,10 @@ document.body.classList.remove('u-overflow-hidden'); } } + + $: if (error) { + alert?.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' }); + } @@ -81,14 +86,16 @@
From 84bf27411491399daab4c3b48e2b2ed6b6161508 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 8 Sep 2022 11:37:50 +0200 Subject: [PATCH 3/7] fix: notifications style --- src/lib/layout/notifications.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/layout/notifications.svelte b/src/lib/layout/notifications.svelte index 7b019f930..202702799 100644 --- a/src/lib/layout/notifications.svelte +++ b/src/lib/layout/notifications.svelte @@ -4,8 +4,8 @@ {#if $notifications} -
-
    +
    +
      {#each $notifications as notification (notification.id)} Date: Fri, 9 Sep 2022 11:29:50 +0200 Subject: [PATCH 4/7] fix: hide form causing layout shift on scroll --- src/routes/console/__layout.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/console/__layout.svelte b/src/routes/console/__layout.svelte index 19f720775..e772abdce 100644 --- a/src/routes/console/__layout.svelte +++ b/src/routes/console/__layout.svelte @@ -47,4 +47,6 @@