From abc69492dc7cf23f0e73d8bf192b23e727a607d8 Mon Sep 17 00:00:00 2001 From: geospatialem Date: Sat, 14 Oct 2017 21:28:27 -0500 Subject: [PATCH 1/2] Skip to CSS update Update the 'Skip to' style updates on-load and on hover/active --- style.css | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 +} From f0378bd6c50ec631fca24ef59d9e97032855d647 Mon Sep 17 00:00:00 2001 From: geospatialem Date: Sat, 14 Oct 2017 21:36:15 -0500 Subject: [PATCH 2/2] Add keypress to 'Skip to' links Add enter and spacebar interaction to the skip to search and skip to list links. --- app.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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(); });