Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Add scroll to top when switching between steps (#315)

Leendert de Borst88e5142049bb
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 @@
/// <summary>
/// Navigates to the next step in the setup process.
/// </summary>
- private void GoNext()
+ private async Task GoNext()
{
_currentStep = _currentStep switch
{
@@ -145,6 +145,9 @@
SetupStep.Password => SetupStep.Creating,
_ => _currentStep
};
+
+ await JsInteropService.ScrollToTop();
+ StateHasChanged();
}
/// <summary>
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)
}
}
+ /// <summary>
+ /// Scrolls to the top of the page.
+ /// </summary>
+ /// <returns>Task.</returns>
+ public async Task ScrollToTop()
+ {
+ await jsRuntime.InvokeVoidAsync("window.scrollTo", 0, 0);
+ }
+
/// <summary>
/// Represents the result of a WebAuthn get credential operation.
/// </summary>