aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx')
-rw-r--r--sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx b/sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx
index 23bad66ea..8c4b740a0 100644
--- a/sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx
+++ b/sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx
@@ -42,15 +42,16 @@ export const ListItemLink = withStyles(styles)((props: IListItemLinkProps) => {
const { icon, primary: Primary, secondary: Secondary, classes, to, exact = false } = props;
const renderLink = (itemProps: any): JSX.Element => (<NavLink exact={ exact } to={ to } activeClassName={ classes.active } { ...itemProps } />);
+ const ariaLabel = typeof Primary === 'string' ? "link-to-"+Primary.toLowerCase().replace(/\s/g, "-") : "link-to-"+Primary.displayName?.toLowerCase();
return (
<>
- <ListItem button component={ renderLink }>
+ <ListItem button component={ renderLink } aria-label={ariaLabel}>
{ icon
? <ListItemIcon>{ icon }</ListItemIcon>
: null
}
{ typeof Primary === 'string'
- ? <ListItemText aria-label={"link-to-"+Primary.toLowerCase()} primary={ Primary } style={{ padding: 0 }} />
+ ? <ListItemText primary={ Primary } style={{ padding: 0 }} />
: <Primary />
}
</ListItem>