NavigateTo does not scroll to the top in internal navigation to same url by ilonatommy · Pull Request #60190 · dotnet/aspnetcore (original) (raw)

Description

If we use NavigateTo with same url as the current one or with only query appended, the navigation action finishes with setting the scroll at the top of the page. It happens even if we were not forcing the external navigation (setting forceLoad=false).

The change:
Now, we are conditioning the scroll action with the check if internal navigation is not happening for the same path. isForSamePath compares ignoring queries.

Fixes #40190