How does focus management on navigation work with the FocusOnNavigate component?

Last updated 5 July 2026

  • FocusOnNavigate moves keyboard focus to a chosen element after each routing navigation, placed inside the Router (usually in App.razor).

  • Its Selector parameter is a CSS selector (commonly h1) and the first match gets focused (headings get tabindex="-1" automatically).

  • It matters for accessibility: SPAs don't reload pages, so browsers never reset focus for screen reader and keyboard users.

  • https://medium.com/@bhargavkoya56/net-10-c-14-deep-dive-for-modern-development-part1-concepts-and-code-snippets-0b875ed38a60
  • https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing?view=aspnetcore-10.0
  • https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/fundamentals/routing.md?plain=1
  • https://www.telerik.com/blogs/blazor-basics-blazor-routing-navigation-fundamentals
All Blazor interview questions