diff --git a/.changeset/real-mails-add.md b/.changeset/real-mails-add.md index 15cdc2997f..2769fef898 100644 --- a/.changeset/real-mails-add.md +++ b/.changeset/real-mails-add.md @@ -3,4 +3,4 @@ '@backstage/plugin-catalog': patch --- -fixed route resolving +fixed route resolving (ssue #7741) when user cannot select a tab in any of the tabbed pages (like the Catalog page) if it shares the same initial letters as a preceding tab. (i.e. where tab with a path of /ci is followed by a path of /cid, user cannot select /cid as /ci will always be selected first). diff --git a/packages/core-components/src/components/TabbedLayout/RoutedTabs.tsx b/packages/core-components/src/components/TabbedLayout/RoutedTabs.tsx index d0c36e286c..c5c771b739 100644 --- a/packages/core-components/src/components/TabbedLayout/RoutedTabs.tsx +++ b/packages/core-components/src/components/TabbedLayout/RoutedTabs.tsx @@ -35,6 +35,7 @@ export function useSelectedSubRoute(subRoutes: SubRoute[]): { // TODO: remove once react-router updated const sortedRoutes = routes.sort((a, b) => + // remove added "/*" symbols from path before comparing b.path.slice(0, -2).localeCompare(a.path.slice(0, -2)), );