From 9d2dd8bed8dff07b1c31bd0f938dca7761fdb5b1 Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Fri, 11 Jan 2019 13:22:10 +0200 Subject: [PATCH] Fix @PushStateNavigation with @PreserveOnRefresh (#11417) Navigation needs to be done also in doRefresh(..) in similar fashion as in doInit(..) Fixes https://github.com/vaadin/framework/issues/11416 --- server/src/main/java/com/vaadin/ui/UI.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/src/main/java/com/vaadin/ui/UI.java b/server/src/main/java/com/vaadin/ui/UI.java index cf9aee4e1a..682e1f38f2 100644 --- a/server/src/main/java/com/vaadin/ui/UI.java +++ b/server/src/main/java/com/vaadin/ui/UI.java @@ -869,6 +869,13 @@ public abstract class UI extends AbstractSingleComponentContainer page.updateLocation(newLocation.toString(), true, false); page.updateBrowserWindowSize(newWidth, newHeight, true); + + // Navigate if there is navigator, this is needed in case of + // PushStateNavigation + Navigator navigator = getNavigator(); + if (navigator != null) { + navigator.navigateTo(navigator.getState()); + } } /** -- 2.39.5