Skip to content

Commit

Permalink
Fix: Small fix for location hash/fragment (#2464)
Browse files Browse the repository at this point in the history
  • Loading branch information
BToersche authored Mar 27, 2024
1 parent f3d19ca commit 73b8c78
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion leptos_dom/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ pub fn location_hash() -> Option<String> {
if is_server() {
None
} else {
location().hash().ok().map(|hash| hash.replace('#', ""))
location().hash().ok().map(|hash| match hash.chars().next() {
Some('#') => hash[1..].to_string(),
_ => hash,
})
}
}

Expand Down

0 comments on commit 73b8c78

Please sign in to comment.