You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @krasimir I'm seeing an issue in 8.4.1 where I call router.navigate with navigateOptions but it doesn't appear to be respecting the options I've set. Here is an abbreviated example of my setup:
constrouter=newNavigo('/');router.on({'/abc-1234': {as: 'routeA',uses: (match)=>{console.log('Should reach here.');},hooks: {before: (done,match)=>{router.navigate('/item/abc-1234',{historyAPIMethod: 'replaceState',updateBrowserURL: true,updateState: true,callHandler: false,force: true});done();}}}});router.on({'/item/abc-1234': {as: 'routeB',uses: (match)=>{console.log('Should not reach here because callHandler=false.')}}});router.resolve();
What I'm expecting from this setup is that when I browse to /abc-1234 it fires the before hook in "routeA", which in turn tells the router to update the browser URL to "/item/abc-1234" and use "replaceState" in the browser history. It should then continue to execute the "routeA" handler and finish.
What I'm actually seeing is that it executes "routeA" correctly but for updating the browser URL. Have I set the navigateOptions correctly?
Additionally, I don't see another entry in browser history so I assume the replaceState method is working correctly but to know for sure, I'd need to see the URL change.
The text was updated successfully, but these errors were encountered:
force is useful when you want to set the internal state of the router. If the value is true it basically stops the resolving and updates the internal flags only.
Hi @krasimir I'm seeing an issue in 8.4.1 where I call
router.navigate
withnavigateOptions
but it doesn't appear to be respecting the options I've set. Here is an abbreviated example of my setup:What I'm expecting from this setup is that when I browse to
/abc-1234
it fires thebefore
hook in "routeA", which in turn tells the router to update the browser URL to "/item/abc-1234" and use "replaceState" in the browser history. It should then continue to execute the "routeA" handler and finish.What I'm actually seeing is that it executes "routeA" correctly but for updating the browser URL. Have I set the
navigateOptions
correctly?Additionally, I don't see another entry in browser history so I assume the
replaceState
method is working correctly but to know for sure, I'd need to see the URL change.The text was updated successfully, but these errors were encountered: