Position navbar to proper item after page refresh

I am using top navbar with two items exactly as in this example: https://vaadin.com/docs/latest/components/app-layout#navbar-vs-drawer. Everything works perfectly except page refresh. After refresh navbar always positioned on the first item regradles of the current page and URL. Could you please advice how to position navbar to the proper item after page refresh?

Navbar is also not positioned properly if I go directly to the second view using direct URL link …