diff --git a/app.js b/app.js index 9a5af88..b25a3ed 100644 --- a/app.js +++ b/app.js @@ -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(); }); diff --git a/style.css b/style.css index ed9214d..2f41c6b 100644 --- a/style.css +++ b/style.css @@ -55,6 +55,7 @@ body { .skip { color: white; + background-color: #002C61; position: fixed; top: 0; left: 0; @@ -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 { @@ -173,4 +175,4 @@ button:hover, button:focus { .arcgisSearch .searchClear { right: 52px; -} \ No newline at end of file +}