mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-03-20 15:41:40 -04:00
Add scroll to top when switching between steps (#315)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user