I have a Spring+Vaadin app that has buttons that call:
UI.getCurrent().navigate(MyView::class.java, myId);
In another words, the NavigationTrigger
is of type UI_NAVIGATE
.
When the click happens, the app navigates to the correct view. However the URL in the browser does not change. I have debugged it step by step and got to this call in History#pushState
:
ui.getPage().executeJs(
"window.dispatchEvent(new CustomEvent('vaadin-navigate', { detail: { state: $0, url: $1, replace: false } }));",
state, pathWithQueryParameters);
This gets executed and all the parameters are correct. I have also added my own listener for the vaadin-navigate
event in the browser and the browser does receive the event. So the only thing I can think of is that the React hook does not execute correctly. I see no errors in the console though.
What’s even more baffling is that this does NOT happen on my personal laptop. There, the push to history works correctly. On the work laptop, it happens in all browsers (Firefox, Chrome, Safari).
Any clue what to try or how to debug this further?