-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigating to the same route is inconsistent #7665
Comments
Let's have an open discussion on this. Haijian will send a calendar invite |
HTML in general will navigate again to the same page GitHub catches routing links but also refreshes issues when clicking on "issues" even if you already are on the "issues" page There are cases where you want the user to be able to refresh by navigating again, such as the GitHub case. Are there cases where you want to avoid navigating even when the link is enabled? |
I do want to avoid trashing and re-creating the DOM content to avoid unnecessary screen flickering. A quick look at several SPAs shows that none of them recreates the views when navigating to the currently active route. In fact, from all SPAs that I have open in my browser(s) at the moment, I cannot find any that does it:
My conclusion here would be that for an SPA re-creating the DOM for the current route is not an expected behavior. I would not want the Router to remove the DOM nodes and re-add them again. I do want to know that the user has requested the navigation though, because I want to re-fetch the view data and update the view if there are changes. As a developer I expect the Router to trigger some sort of event on each view in the view chain to inform that a navigation event has occurred so that I can trigger a refresh. |
This should be fixed with vaadin-router 1.7.2. |
Go to start.vaadin.com
Start the projects, open http://localhost:9090/dashboard and click on "dashboard" in the menu multiple times.
Expectation:
Regardless of whether the "master detail" view is using Java or Typescript, clicking on "Dashboard" view produces the same result
Actual:
In the Java only application (V14), more and more series are added to the charts when clicking. This is because
afterNavigation
is called for each clickIn the Java+TS application (V15), nothing happens when clicking
The text was updated successfully, but these errors were encountered: