Skip to content

Commit e49fe5b

Browse files
authored
Fix client side router issue with handling hash (#3763)
1 parent ff363eb commit e49fe5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/kit/src/runtime/client/router.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export class Router {
188188
// This will ensure the `hashchange` event is fired
189189
// Removing the hash does a full page navigation in the browser, so make sure a hash is present
190190
const [base, hash] = url.href.split('#');
191-
if (hash && base === location.href.split('#')[0]) {
191+
if (hash !== undefined && base === location.href.split('#')[0]) {
192192
// Call `pushState` to add url to history so going back works.
193193
// Also make a delay, otherwise the browser default behaviour would not kick in
194194
setTimeout(() => history.pushState({}, '', url.href));

0 commit comments

Comments
 (0)