Skip to content

Commit d297a1b

Browse files
committed
fix ispathmatchinroute
1 parent aac5e0a commit d297a1b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/ui/src/utilities/routeResolution/isPathMatchingRoute.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ export const isPathMatchingRoute = ({
3535
}
3636

3737
if (!exact) {
38-
return viewRoute.startsWith(currentRoute)
38+
if (!currentRoute.startsWith(viewRoute)) {
39+
return false
40+
}
41+
42+
const remainingPath = currentRoute.slice(viewRoute.length)
43+
44+
return remainingPath === '' || remainingPath.startsWith('/')
3945
}
4046
}

0 commit comments

Comments
 (0)