Skip to content

Commit

Permalink
Merge pull request #815 from hackforla/FRONT-AccessibilityPanelTweak
Browse files Browse the repository at this point in the history
Accessibility Panel Tweak
  • Loading branch information
adamkendis authored Oct 5, 2020
2 parents f7b274f + a92032f commit 6a5cfaa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion client/components/main/header/AccessibilityPane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const AccessibilityPane = () => {
updateIsOpen(!isOpen);
};

const handleKeyDown = e => {
if (e.key === ' ' || e.key === 'Enter') {
handleClick(e);
}
};

const renderInstructions = () => ACCESSIBILITY_INSTRUCTIONS.map((element, index) => {
if (index % 2 !== 0) {
return (
Expand All @@ -40,7 +46,7 @@ const AccessibilityPane = () => {
<div // eslint-disable-line
className={dropdownClassName}
tabIndex={0}
onKeyDown={handleClick}
onKeyDown={handleKeyDown}
aria-expanded={isOpen}
role="button"
>
Expand Down
8 changes: 7 additions & 1 deletion client/components/main/header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ const Header = () => {
setActiveBurger(!activeBurger);
};

const handleKeyDown = e => {
if (e.key === ' ' || e.key === 'Enter') {
handleClick(e);
}
};

return (
<nav
className="navbar"
Expand All @@ -49,7 +55,7 @@ const Header = () => {
aria-label="menu"
aria-expanded={activeBurger}
onClick={handleClick}
onKeyDown={handleClick}
onKeyDown={handleKeyDown}
>
<span aria-hidden="true" />
<span aria-hidden="true" />
Expand Down
2 changes: 1 addition & 1 deletion client/styles/main/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
right: auto;
left: -350px;
top: 45px;
height: calc(100vh - #{$header-height + $hamburger-height});
height: calc(100vh - #{$header-height + $hamburger-height + 40px});
}
}

Expand Down

0 comments on commit 6a5cfaa

Please sign in to comment.