question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BeforeEnterEvent's rerouteTo doesn't update the URL

See original GitHub issue

<vaadin.version>10.0.0.beta10</vaadin.version> Example app: MainView.java

@Route("")
public class MainView extends VerticalLayout implements BeforeEnterObserver {

    @Override
    public void beforeEnter(BeforeEnterEvent event) {
        event.rerouteTo("second");
    }
}

SecondView.java

@Route("second")
public class SecondView extends VerticalLayout {

    public SecondView() {
        add(new Label("hello"));
    }
}

After opening the app at localhost, I see the “hello” label, but the URL is still http://localhost:8080/. I’d expect it to be http://localhost:8080/second

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:17
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
plekucommented, Dec 11, 2018

Acceptance Criteria

1reaction
plekucommented, May 29, 2018

We also have an issue for postponing showing the wrong url #3619, but I don’t see why on reroute we would not show the changed url out of the box. @Legioth or @caalador do you recall any specific reason for this or it is just not added ? I think a simple replaceState with the new url should be done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue Router beforeEnter vs beforeEach - Stack Overflow
I tried beforeEach() but it doesn't fire when user enter site with direct url like /home , /event . Per-Route Guard beforeEnter() works ......
Read more >
Ionic 5/6 with Vue: Pages do not change sometimes (URL does)
Hi there, I'm currently working on my first ionic project as for my bachelor thesis and have quite some issues with changing the...
Read more >
Navigation Lifecycle | Routing and Navigation | Flow - Vaadin
The forwardTo method reroutes navigation and updates the browser URL. Forwarding can be used during BeforeEnter and BeforeLeave lifecycle states ...
Read more >
Guide to Vue Router Redirects - Stack Abuse
In this guide, learn how to redirect a user in Vue programmatically ... In a situation where we don't want the URL to...
Read more >
Routing in Vue3: Navigating the Options - CODE Magazine
{ path: 'cat/:url', name: 'Cat', component: Cat, beforeEnter: (to, from, next) => { next(); } },. The parameters here are identical but it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found