]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix @PushStateNavigation with @PreserveOnRefresh (#11417) pr11403/r8
authorTatu Lund <tatu@vaadin.com>
Fri, 11 Jan 2019 11:22:10 +0000 (13:22 +0200)
committerSun Zhe <31067185+ZheSun88@users.noreply.github.com>
Fri, 11 Jan 2019 11:22:10 +0000 (13:22 +0200)
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

index cf9aee4e1a79fe957867da0b8a266c3d05b41cee..682e1f38f2fdb19cd51db4e71efb2f4d499fe7e7 100644 (file)
@@ -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());
+        }
     }
 
     /**