Skip to content

Commit

Permalink
fix: compare path components to detect active link in router (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
flo-at authored Sep 6, 2023
1 parent 495862e commit db20be5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion router/src/components/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ where
if exact {
loc == path
} else {
loc.starts_with(&path)
std::iter::zip(loc.split('/'), path.split('/'))
.all(|(loc_p, path_p)| loc_p == path_p)
}
})
})
Expand Down

0 comments on commit db20be5

Please sign in to comment.