-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FocusOnNavigate does not work (dotnet8 - BlazorWebApp) #52412
Comments
Any ideas on how to fix that issue for SSR? I created a component and added it The component subscribed to |
I added this piece of code to my
Found the solution while reading https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/static-server-rendering?view=aspnetcore-8.0 (loading scripts for SSR pages) |
Thanks for contacting us. We're moving this issue to the |
This issue should not be fixed asap. I can't wait 11 months (.NET 9), it is a showstopper. Have a look at this video. Just create 2 long pages and add them to the NavMenu. It is horrible. I hope there is a workaround. Blazor8.Scroll.issue.mp4 |
I have this problem in 7 (version). |
@Andrey-2021 @sonnemaf Did you see my previous comment I know it's a dirty/quick fix but at least you can use Blazor on prod with a nicer navigation experience. |
@ZANZAAA Yes your fix it works! Still hope to get the bug fix earlier than |
Now you can in |
This will be handled as part of #53142 |
I experienced this and resolved by using a CSS id tag. I initially resolved using a class, but an id seems like the right approach to ensure a single item is selected. <FocusOnNavigate RouteData="@routeData" Selector="#main-content-section" /> |
Is there an existing issue for this?
Describe the bug
The user's scrolling position will be maintained when navigating to a new page.
The
<h1>
element does not have the focus.Even though
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
is correctly seth1
HTML tagExpected Behavior
After navigating from one page to another, sets focus to an element matching a CSS selector.
Source
Steps To Reproduce
<h1>
element.Exceptions (if any)
No response
.NET Version
8
Anything else?
No response
The text was updated successfully, but these errors were encountered: