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 @@