diff --git a/src/AliasVault.Client/Auth/Pages/Setup/Setup.razor b/src/AliasVault.Client/Auth/Pages/Setup/Setup.razor
index ec1e37f7c..d371cc9ac 100644
--- a/src/AliasVault.Client/Auth/Pages/Setup/Setup.razor
+++ b/src/AliasVault.Client/Auth/Pages/Setup/Setup.razor
@@ -135,7 +135,7 @@
///
/// Navigates to the next step in the setup process.
///
- private void GoNext()
+ private async Task GoNext()
{
_currentStep = _currentStep switch
{
@@ -145,6 +145,9 @@
SetupStep.Password => SetupStep.Creating,
_ => _currentStep
};
+
+ await JsInteropService.ScrollToTop();
+ StateHasChanged();
}
///
diff --git a/src/AliasVault.Client/Services/JsInteropService.cs b/src/AliasVault.Client/Services/JsInteropService.cs
index 272829a61..d32645134 100644
--- a/src/AliasVault.Client/Services/JsInteropService.cs
+++ b/src/AliasVault.Client/Services/JsInteropService.cs
@@ -228,6 +228,15 @@ public sealed class JsInteropService(IJSRuntime jsRuntime)
}
}
+ ///
+ /// Scrolls to the top of the page.
+ ///
+ /// Task.
+ public async Task ScrollToTop()
+ {
+ await jsRuntime.InvokeVoidAsync("window.scrollTo", 0, 0);
+ }
+
///
/// Represents the result of a WebAuthn get credential operation.
///