Skip to content

[Blazor] Navigating to a page will scroll to top before rendering new page #53863

Open
@danielchalmers

Description

@danielchalmers

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Using NavigationManager.NavigateTo to change pages while you are partially scrolled down the page will visibly and jarringly scroll to the top before navigating to the new page.

Expected Behavior

The user should keep seeing the same viewport until the new page has rendered.

I know there's going to be a technical reason for this, but it just looks so unpleasant and I don't know how to work around it.

Steps To Reproduce

This was done on .NET MAUI Blazor Hybrid with MudBlazor. If a repo is needed, please let me know and I'll happily go make one.

Exceptions (if any)

No response

.NET Version

8.0.100

Anything else?

You can see in this video that I scroll down then click a button to navigate the page which then scrolls back up before navigating to the new page.

Video.mp4

It looks really bad for the user.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions