Resolve selected tab value through alias map

When the selected tab uses an aliased group ID, resolve it through
the alias map so the MUI Tabs selection indicator matches the
rendered group key.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-02-26 11:48:51 +01:00
parent 3be516b73a
commit 1b32ec6a8b
@@ -171,6 +171,11 @@ export function EntityTabsList(props: EntityTabsListProps) {
}, [items, groupDefinitions, aliasToGroup, defaultContentOrder]);
const selectedItem = items[selectedIndex];
const selectedGroup = resolveGroupId(
selectedItem?.group,
groupDefinitions,
aliasToGroup,
);
return (
<Box className={styles.tabsWrapper}>
<Tabs
@@ -180,7 +185,7 @@ export function EntityTabsList(props: EntityTabsListProps) {
variant="scrollable"
scrollButtons="auto"
aria-label={t('entityTabs.tabsAriaLabel')}
value={selectedItem?.group ?? selectedItem?.id}
value={selectedGroup ?? selectedItem?.id}
>
{groups.map(([id, tabGroup]) => (
<EntityTabsGroup