dotnet / dotnet/aspnetcore

NavigationManager change URL without redirection

Open
#42,443 8 comments 9 reactions 0 assignees View on GitHub
area-blazor enhancement feature-blazor-routing
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.navigationmanager.notifylocationchanged?view=aspnetcore-6.0

The option to change the URL without performing a redirect is missing. Useful for the virtual component where the element is loaded every now and then.

### Describe the solution you'd like

If we have a lot of dynamic content, scroll lower and suddenly the browser closes, then after returning we go back to the top.
A class that changes the URL address and saves it in the hostory but does not move us would be useful.

I think it works like this in javascript
```
history.pushState('', 'New Page Title', newHREF);
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the NavigationManager.NotifyLocationChanged API documentation linked in the issue and compare its behavior with the browser history.pushState example. Define how a URL update without navigation should affect history, scroll position, and location notifications; done means the behavior is specified and verified for the described dynamic-content scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, javascript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.