From 711b5ac4b4f73505fcdc4ad527266795dffff702 Mon Sep 17 00:00:00 2001 From: Daniel Chalmers Date: Wed, 6 Mar 2024 19:40:48 -0600 Subject: [PATCH] Smooth scrolling is back, again!...in some areas --- JournalApp/Components/Pages/MoodGrid/MoodGridPage.razor | 8 ++++---- JournalApp/wwwroot/index.html | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/JournalApp/Components/Pages/MoodGrid/MoodGridPage.razor b/JournalApp/Components/Pages/MoodGrid/MoodGridPage.razor index 8674ab3..ca622aa 100644 --- a/JournalApp/Components/Pages/MoodGrid/MoodGridPage.razor +++ b/JournalApp/Components/Pages/MoodGrid/MoodGridPage.razor @@ -96,14 +96,14 @@ } } - async Task ScrollToMonth(int month) + async Task ScrollToMonth(int month, bool smooth = false) { - logger.LogDebug($"Scrolling to month {month}"); + logger.LogDebug($"Scrolling to month {month}, smooth: {smooth}"); - await JSRuntime.InvokeVoidAsync("scrollToTopOfNestedElement", ".mood-grid", $"#mood-grid-month-{month}"); + await JSRuntime.InvokeVoidAsync("scrollToTopOfNestedElement", ".page-body", $"#mood-grid-month-{month}", smooth ? "smooth" : "instant"); } - async Task ScrollToOpenToDate() => await ScrollToMonth(OpenToDate.Month); + async Task ScrollToOpenToDate() => await ScrollToMonth(OpenToDate.Month, true); async Task HeaderClicked() => await ScrollToMonth(DateTime.Now.Month); diff --git a/JournalApp/wwwroot/index.html b/JournalApp/wwwroot/index.html index 29eafdb..2b89321 100644 --- a/JournalApp/wwwroot/index.html +++ b/JournalApp/wwwroot/index.html @@ -33,11 +33,12 @@