From 9a2dbace3078a803070de88f09343d27e1f95dbe Mon Sep 17 00:00:00 2001 From: Ian Oxley Date: Tue, 13 Nov 2018 22:26:55 +0000 Subject: [PATCH 1/7] Add aria-label to Gems and Gold icons Add `aria-label` attributes to the gems and gold icons in the menu. Make the gems icon a link, with a href set to `#buy-gems`, which is the element that contains the gems dialog. --- website/client/components/header/menu.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/client/components/header/menu.vue b/website/client/components/header/menu.vue index ed0fe4986e..3bb0e88652 100644 --- a/website/client/components/header/menu.vue +++ b/website/client/components/header/menu.vue @@ -62,10 +62,10 @@ div .top-menu-icon.svg-icon(v-html="icons.hourglasses", v-b-tooltip.hover.bottom="$t('mysticHourglassesTooltip')") span {{ userHourglasses }} .item-with-icon - .top-menu-icon.svg-icon.gem(v-html="icons.gem", @click='showBuyGemsModal("gems")', v-b-tooltip.hover.bottom="$t('gems')") + a.top-menu-icon.svg-icon.gem(:aria-label="$t('gems')", href="#buy-gems" v-html="icons.gem", @click.prevent='showBuyGemsModal("gems")', v-b-tooltip.hover.bottom="$t('gems')") span {{userGems}} .item-with-icon.gold - .top-menu-icon.svg-icon(v-html="icons.gold", v-b-tooltip.hover.bottom="$t('gold')") + .top-menu-icon.svg-icon(:aria-label="$t('gold')", v-html="icons.gold", v-b-tooltip.hover.bottom="$t('gold')") span {{Math.floor(user.stats.gp * 100) / 100}} .form-inline.desktop-only a.item-with-icon(@click="sync", v-b-tooltip.hover.bottom="$t('sync')") From 4718e5e5ea774cb836e0cb700531307126cb5c68 Mon Sep 17 00:00:00 2001 From: Ian Oxley Date: Fri, 23 Nov 2018 20:38:06 +0000 Subject: [PATCH 2/7] Improve a11y for the sync links Add `role="link"` so it shows up as a link in VoiceOver. Add `tabindex="0" so it can receive keyboard focus, and a keyup handler for the enter key so it will respond to `` keypresses. Add `aria-label="$t('sync')"` to add text for non-visual users. Add aria-label to mobile sync icon link. --- website/client/components/header/menu.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/client/components/header/menu.vue b/website/client/components/header/menu.vue index 3bb0e88652..4c861709a2 100644 --- a/website/client/components/header/menu.vue +++ b/website/client/components/header/menu.vue @@ -9,7 +9,7 @@ div .svg-icon.gryphon.d-xs-block.d-xl-none b-nav-toggle(target='menu_collapse').menu-toggle .quick-menu.mobile-only.form-inline - a.item-with-icon(@click="sync", v-b-tooltip.hover.bottom="$t('sync')") + a.item-with-icon(@click="sync", v-b-tooltip.hover.bottom="$t('sync')", :aria-label="$t('sync')") .top-menu-icon.svg-icon(v-html="icons.sync") notification-menu.item-with-icon user-dropdown.item-with-icon @@ -68,7 +68,7 @@ div .top-menu-icon.svg-icon(:aria-label="$t('gold')", v-html="icons.gold", v-b-tooltip.hover.bottom="$t('gold')") span {{Math.floor(user.stats.gp * 100) / 100}} .form-inline.desktop-only - a.item-with-icon(@click="sync", v-b-tooltip.hover.bottom="$t('sync')") + a.item-with-icon(@click="sync", @keyup.enter="sync", role="link", :aria-label="$t('sync')", tabindex="0", v-b-tooltip.hover.bottom="$t('sync')") .top-menu-icon.svg-icon(v-html="icons.sync") notification-menu.item-with-icon user-dropdown.item-with-icon From 5753d3e648a44e43cb29abf3f924cc7a21bbf09b Mon Sep 17 00:00:00 2001 From: Ian Oxley Date: Fri, 23 Nov 2018 22:20:37 +0000 Subject: [PATCH 3/7] Improve a11y for the dropdown menu Add role="button" to make the component report itself as a button. Add tabindex so the menu toggle can receive keyboard focus. Add keydown handlers for `` and `` so the dropdown menu toggle responds to keyboard input. Set the aria-pressed attribute to true if the menu is open, or false if it is closed. --- website/client/components/ui/customMenuDropdown.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/website/client/components/ui/customMenuDropdown.vue b/website/client/components/ui/customMenuDropdown.vue index ddbf549e59..669f2a3c92 100644 --- a/website/client/components/ui/customMenuDropdown.vue +++ b/website/client/components/ui/customMenuDropdown.vue @@ -3,7 +3,7 @@ A simplified dropdown component that doesn't rely on buttons as toggles like bo -->