-
Notifications
You must be signed in to change notification settings - Fork 167
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
Browser back navigation does not work when using replaceState with React enabled #19839
Comments
The issue was assigned to a developer and is currently being investigated |
Tested the given example. Looks like it is working as intended, since The only difference between the two calls is that |
Here's a similar example from https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState. Looks like |
Never mind, I seem to have misunderstood the issue in the first place. Nevertheless, using |
Hi, thanks for your work on this. In the past, we've tended to used From what I can see, there's been a change in behavior from Vaadin router to React router where If that's how it's meant to work, I'm OK with that! It will actually end up making some of our code a little bit cleaner 😄 |
Thanks for your reply! I see what you mean about navigation loop, it is very annoying. Anyway, looking further there seems to be an issue here, since the first Did not dig deeper into |
This will most likely be fixed when a new version of react-router with this fix has been released. |
Status update: Unfortunately latest version of react-router did not fix this issue. We are currently investigating a way to fix this in Flow. Will update once we have something. |
Fixes #19839 --------- Co-authored-by: caalador <[email protected]> Co-authored-by: Teppo Kurki <[email protected]>
Fixes #19839 --------- Co-authored-by: Anton Platonov <[email protected]> Co-authored-by: caalador <[email protected]> Co-authored-by: Teppo Kurki <[email protected]>
Fixes #19839 --------- Co-authored-by: caalador <[email protected]> Co-authored-by: Teppo Kurki <[email protected]>
Fixes #19839 --------- Co-authored-by: Anton Platonov <[email protected]> Co-authored-by: Teppo Kurki <[email protected]>
This ticket/PR has been released with Vaadin 24.5.0.beta4 and is also targeting the upcoming stable 24.5.0 version. |
This ticket/PR has been released with Vaadin 24.4.13. |
Description of the bug
If the current page used replaceState to modify the page history in an afterNavigation observer (for example, to add a query parameter), page history gets messed up. This causes back navigation using the browser back button to go back to 2 pages ago, instead of one page ago.
This worked in v23 but is broken in v24. A workaround is to disable React.
Expected behavior
Back navigation should only go back one page.
Minimal reproducible example
react-router-back-nav.zip
Run using
mvn jetty:run
and open localhost:8080.Versions
The text was updated successfully, but these errors were encountered: