We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6bd99e commit 6b971a0Copy full SHA for 6b971a0
src/client/app/router.ts
@@ -180,7 +180,7 @@ export function createRouter(
180
: link.href,
181
link.baseURI
182
)
183
- const currentUrl = window.location
+ const currentUrl = new URL(window.location.href) // copy to keep old data
184
// only intercept inbound html links
185
if (
186
!e.ctrlKey &&
@@ -211,7 +211,12 @@ export function createRouter(
211
window.scrollTo(0, 0)
212
}
213
} else {
214
- go(href)
+ go(href).then(() => {
215
+ // do after the route is changed so location.hash in theme code is the new hash
216
+ if (hash !== currentUrl.hash) {
217
+ window.dispatchEvent(new Event('hashchange'))
218
+ }
219
+ })
220
221
222
0 commit comments