Skip to content

Commit 6c1c260

Browse files
committed
fix(side-navbar): keyboard a11y
replace div with button to allow activation using space and enter Signed-off-by: Gaurav Gupta<[email protected]>
1 parent 1e23727 commit 6c1c260

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/components/form-field/form-field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as ReactForm from 'react-form';
44

55
import { Select as ArgoSelect, SelectOption, SelectProps } from '../select/select';
66

7-
const uuid = require('uuid/v1');
7+
const uuid = require('uuid');
88

99
require('./form-field.scss');
1010

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>

stories/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Store, withState } from '@dump247/storybook-state';
22
import { storiesOf } from '@storybook/react';
3-
import createHistory from 'history/createBrowserHistory';
3+
import { createBrowserHistory as createHistory } from 'history';
44
import * as React from 'react';
55
import { Route, Router } from 'react-router';
66
import { timer } from 'rxjs';

0 commit comments

Comments
 (0)