When i navigate between views, CSS isnt loaded properly, if i refresh the site, it works fine. This is the code in my first view :
@UIScoped
@Route("login")
@HtmlImport("frontend://styles/shared-styles.html")
public class LoginView extends Div {
and this is the code in a button i have in this view :
signinButton.addClickListener(event -> {
// login
if (userLogin.isLoggedIn()) {
UI.getCurrent().navigate("View2");
} else {
Notification.show("Error");
}
});
class userLogin merely returns a boolean variable that tells me if im logged in or not.
and this is how the second view is written
@Route("View1")
@PWA(name = "TestApp", shortName = "TestApp")
@HtmlImport("frontend://styles/shared-styles.html")
@UIScoped
public class View1 extends Div implements View, BeforeEnterObserver {
in the attachments bellow theres also screenshots of how it should look and how it looks, apologies for blurring data. As you can see, the CSS for vaadin.flow.grid isnt loaded at all, or rather its like the component doesnt fully load (u can also see that same thing happening in the orange label), this also happens, if after i get from loginview to view1, i dont refresh and go straight to view2, the grid looks the same, doesnt load properly. Again, if i refresh everything goes to how it should look.