From 7bfe65740190a8ac95bbce175659cab95e765862 Mon Sep 17 00:00:00 2001 From: agathanon <88989307+agathanon@users.noreply.github.com> Date: Sat, 21 Oct 2023 20:13:14 -0400 Subject: [PATCH] Smooth scroll to top if active screen selected in web UI (#175) * Smooth scroll to top if active screen selected in web UI * Use fullname repo --------- Co-authored-by: agathanonymous Co-authored-by: Brahim Hadriche --- .github/workflows/lint.yml | 1 + playlet-web/src/lib/BottomNavigation.svelte | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 26157981..60ed4498 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,6 +17,7 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - name: Configure repo run: | diff --git a/playlet-web/src/lib/BottomNavigation.svelte b/playlet-web/src/lib/BottomNavigation.svelte index 285145aa..721441d2 100644 --- a/playlet-web/src/lib/BottomNavigation.svelte +++ b/playlet-web/src/lib/BottomNavigation.svelte @@ -8,6 +8,12 @@ function setScreen(screen: AppState["screen"]) { appStateStore.update((state) => { + if (state.screen === screen) { + window.scrollTo({ + top: 0, + behavior: "smooth", + }); + } state.screen = screen; return state; });