Skip to content

Commit

Permalink
fix(side-navbar): keyboard a11y
Browse files Browse the repository at this point in the history
replace div with button to allow activation using space and enter

Signed-off-by: Gaurav Gupta<[email protected]>
  • Loading branch information
gaurav5430 committed May 20, 2022
1 parent 1e23727 commit 6c1c260
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/form-field/form-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as ReactForm from 'react-form';

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

const uuid = require('uuid/v1');
const uuid = require('uuid');

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

Expand Down
4 changes: 4 additions & 0 deletions src/components/nav-bar/nav-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,9 @@ $nav-break-height-sm: 746px;
.nav-bar__item {
margin: 10px 0;
font-size: 25px;
font-family: inherit;
line-height: 1.5;
display: block;
width: 100%;
}
}
4 changes: 2 additions & 2 deletions src/components/nav-bar/nav-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export const NavBar: React.FunctionComponent<NavBarProps> = (props: NavBarProps,
<div className='nav-bar__version'>{props.version && props.version()}</div>
{(props.items || []).map((item) => (
<Tooltip content={item.title} placement='right' arrow={true} key={item.path + item.title}>
<div className={classNames('nav-bar__item', { active: isActiveRoute(locationPath, item.path) })}
<button type="button" className={classNames('nav-bar__item', { active: isActiveRoute(locationPath, item.path) })}
onClick={() => context.router.history.push(item.path)}>
<i className={item.iconClassName}/>
</div>
</button>
</Tooltip>
))}
</div>
Expand Down
2 changes: 1 addition & 1 deletion stories/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Store, withState } from '@dump247/storybook-state';
import { storiesOf } from '@storybook/react';
import createHistory from 'history/createBrowserHistory';
import { createBrowserHistory as createHistory } from 'history';
import * as React from 'react';
import { Route, Router } from 'react-router';
import { timer } from 'rxjs';
Expand Down

0 comments on commit 6c1c260

Please sign in to comment.