Skip to content

Commit

Permalink
Fix: Small fix for location hash/fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
BToersche committed Mar 24, 2024
1 parent f3d19ca commit 15ac1c8
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 15ac1c8

Please sign in to comment.