Skip to content

Commit

Permalink
fix(routing): preserve hash
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Aug 19, 2022
1 parent 588ae6b commit 5bf52ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/brave-snails-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hydrofoil/shell-routing": patch
---

Preserve hash fragment when routing changes
2 changes: 1 addition & 1 deletion packages/routing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const routing = ({ appPath = '/', pathPrefix = '' }: Options = {}) => {
const path = resourceUrl.pathname.replace(prefixPattern, '')

if (url.hostname === resourceUrl.hostname) {
return `${appPath}${path}${resourceUrl.search}`
return `${appPath}${path}${resourceUrl.search}${resourceUrl.hash}`
}
return `${appPath}/${href}`
}
Expand Down

0 comments on commit 5bf52ca

Please sign in to comment.