Open Bilchenko opened 2 years ago
BlazorHistory should work with both blazor server and web assembly. But I don't remember testing it in blazor server. I would need to do some tests on my local to see what's happening. Can you share your steps to reproduce this issue?
What I think it could be happening its that blazor server history.scrollRestoration it's not being preserved or is not in auto on blazor server.
Create new project Blazor Server.
NuGet: BlazorHistory 1.0.0
Modify Program.cs
builder.Services.AddBlazorHistoryService();
Modify Index.razor:
@for (var i = 0; i <= 100; i++)
{
<p>test line</p>
}
<a href="Counter">Go to Counter</a>
I have used from your demo:
async() => await BlazorHistoryService.ScrollRestoration(ScrollRestorationType.Auto)
async() => await BlazorHistoryService.ScrollRestoration(ScrollRestorationType.Manual)
await BlazorHistoryService.ScrollRestoration()
scrollRestoration lokks like changed, but index page still opening from top on back action.
Hi,
I've tested your BlazorHistory package in Blazor WebAssembly (client-side) VS 2022 .Net Core 6.0 Scroll position is restored on back action.
Unfraternally, BlazorHistory package in Blazor Server (server-side) is not work (VS 2022 .Net Core 6.0). Scroll position is not restored.
Is BlazorHistory designed only for Blazor WebAssembly (client-side)?