Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,29 @@ require([
) {

/**
* Focus the search widget when someone clicks
* Focus the search widget when someone clicks or uses the 'spacebar' or 'enter' keys
* the "Skip to search" skip link.
*/
document.getElementById('skip-search').addEventListener('keypress', function (e) {
if (e.keyCode == 13 || e.keyCode == 32 || e.charCode == 32) {
search.focus();
}
});

document.getElementById('skip-search').addEventListener('click', function (e) {
search.focus();
});

/**
* Focus the first focusable item in the list
* when someone clicks the "Skip to list" link
* when someone clicks or uses the 'spacebar' or 'enter' keys to the "Skip to list" link
*/
document.getElementById('skip-list').addEventListener('keypress', function (e) {
if (e.keyCode == 13 || e.keyCode == 32 || e.charCode == 32) {
focusFirstItemInList();
}
});

document.getElementById('skip-list').addEventListener('click', function (e) {
focusFirstItemInList();
});
Expand Down
8 changes: 5 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ body {

.skip {
color: white;
background-color: #002C61;
position: fixed;
top: 0;
left: 0;
Expand All @@ -76,8 +77,9 @@ body {
clip: auto;
}

.skip:hover, .skip:focus {
background-color: #002C61;
.skip:hover, .skip:active {
background-color: rgba(255,255,255,.3);
color: #002C61;
}

#list {
Expand Down Expand Up @@ -173,4 +175,4 @@ button:hover, button:focus {

.arcgisSearch .searchClear {
right: 52px;
}
}