Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit c8eaa3c

Browse files
author
Evan Horne
committed
fix(navmenu): skip to main now works
1 parent 0b83efd commit c8eaa3c

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

src/Filter/BasicFilter.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ export class BasicFilter extends React.Component<BasicFilterProps, {}> {
191191
label = label.replace(/\ /g, "-");
192192

193193
return (
194-
<div id={`${label}-bf`.toLocaleLowerCase()} className="bf-selection">
194+
<div
195+
id={`${label}-bf`.toLocaleLowerCase()}
196+
className="bf-selection"
197+
tabIndex={0}
198+
>
195199
{this.renderCategory()}
196200
</div>
197201
);

src/Layout/NavMenu.tsx

+11-10
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export class NavMenu extends React.Component<NavMenuProps, {}> {
2424

2525
handleKeyDown = (e: React.KeyboardEvent<HTMLAnchorElement>) => {
2626
if (e.keyCode === 13) {
27-
const link = e.target as HTMLElement;
28-
const element = document.getElementById(this.props.mainContentId);
29-
link.blur();
30-
if (element) {
31-
element.scrollIntoView();
27+
const elem = e.target as HTMLElement;
28+
elem.blur();
29+
const body = document.getElementById("enter-item-id-bf");
30+
if (body) {
31+
body.scrollIntoView();
3232
}
3333
}
3434
};
@@ -37,14 +37,15 @@ export class NavMenu extends React.Component<NavMenuProps, {}> {
3737
return (
3838
<header role="navigation">
3939
<div id="skip-main">
40-
<a
41-
role="link"
40+
<NavLink
41+
to="/BrowseItems"
42+
exact
43+
activeClassName="active"
4244
className="skip-link"
43-
tabIndex={0}
44-
onKeyDown={this.handleKeyDown}
45+
onKeyUp={this.handleKeyDown}
4546
>
4647
Skip to main content
47-
</a>
48+
</NavLink>
4849
</div>
4950
<nav className="nav-container" role="navigation">
5051
<div className="nav-content container">

0 commit comments

Comments
 (0)