Skip to content

Commit 14f8b22

Browse files
committed
fix(side-navbar): keyboard a11y
replace div with button to allow activation using space and enter
1 parent 1e23727 commit 14f8b22

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/components/nav-bar/nav-bar.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,9 @@ $nav-break-height-sm: 746px;
105105
.nav-bar__item {
106106
margin: 10px 0;
107107
font-size: 25px;
108+
font-family: inherit;
109+
line-height: 1.5;
110+
display: block;
111+
width: 100%;
108112
}
109113
}

src/components/nav-bar/nav-bar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ export const NavBar: React.FunctionComponent<NavBarProps> = (props: NavBarProps,
3535
<div className='nav-bar__version'>{props.version && props.version()}</div>
3636
{(props.items || []).map((item) => (
3737
<Tooltip content={item.title} placement='right' arrow={true} key={item.path + item.title}>
38-
<div className={classNames('nav-bar__item', { active: isActiveRoute(locationPath, item.path) })}
38+
<button type="button" className={classNames('nav-bar__item', { active: isActiveRoute(locationPath, item.path) })}
3939
onClick={() => context.router.history.push(item.path)}>
4040
<i className={item.iconClassName}/>
41-
</div>
41+
</button>
4242
</Tooltip>
4343
))}
4444
</div>

0 commit comments

Comments
 (0)