Skip to content

Commit 33e8a55

Browse files
author
“yndira-flowforge”
committed
Preserve URL hash when updating query parameters with replaceState
1 parent 699880e commit 33e8a55

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/pricing/index.njk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,8 @@ hubspot:
447447
448448
// Update the history
449449
let paramString = urlParams.toString();
450-
window.history.replaceState({}, '', paramString ? "?" + paramString : window.location.pathname);
450+
let currentHash = window.location.hash; // Preserve the current hash
451+
window.history.replaceState({}, '', paramString ? "?" + paramString + currentHash : window.location.pathname + currentHash);
451452
}
452453
453454
// Check the hosting parameter when the page loads

0 commit comments

Comments
 (0)