When I click on a link that targets the current page no server-side round-trip takes place and no navigation events are triggered.
Click prints (when I wanna enter the route for the first time):
Was I called 0?
Was I called 1?
Was I called 2?
Click prints (when I'm already on the route):
Expected behavior
Like in previous versions: The Navigation Observer gets triggered so that I can "reload" the page for people clicking the same link in a menu.
Click prints (when I wanna enter the route for the first time):
Was I called 0?
Was I called 1?
Was I called 2?
Click prints (when I'm already on the route):
Was I called 1?
Was I called 2?
Minimal reproducible example
@Route(value = "test", layout = MainLayout.class) // Your Main Layout of choice where you place a router link to this view
public class TestView extends Div implements BeforeEnterObserver, AfterNavigationObserver {
public TestView() {
System.out.println("Was I called 0?");
}
@Override
public void beforeEnter(BeforeEnterEvent event) {
System.out.println("Was I called 1?");
}
@Override
public void afterNavigation(AfterNavigationEvent afterNavigationEvent) {
System.out.println("Was I called 2?");
}
}
Description of the bug
When I click on a link that targets the current page no server-side round-trip takes place and no navigation events are triggered.
Expected behavior
Like in previous versions: The Navigation Observer gets triggered so that I can "reload" the page for people clicking the same link in a menu.
Minimal reproducible example
Versions