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:
- Created 5 years ago
- Reactions:17
- Comments:7 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Acceptance Criteria
forwardTo
method with the suitable overloads like withrerouteTo
and same semanticshistory.replaceState
instead ofpushState
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.