From 7fa58138a4401bc0cc1907fd93d7d312decd55b2 Mon Sep 17 00:00:00 2001 From: John Cowen Date: Thu, 9 Jul 2020 13:41:34 +0100 Subject: [PATCH] ui: Enable keyboard access for the sorting dropdown menus (#8267) --- ui-v2/app/components/aria-menu/index.js | 5 +++-- ui-v2/app/components/popover-select/index.hbs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui-v2/app/components/aria-menu/index.js b/ui-v2/app/components/aria-menu/index.js index 2c1daff70c..78eca1e94f 100644 --- a/ui-v2/app/components/aria-menu/index.js +++ b/ui-v2/app/components/aria-menu/index.js @@ -82,9 +82,10 @@ export default Component.extend({ // TODO: We need to use > somehow here so we don't select submenus const $items = [...this.dom.elements(MENU_ITEMS, this.$menu)]; if (!this.expanded) { - this.$trigger.dispatchEvent(new MouseEvent('click')); if (e.keyCode === ENTER || e.keyCode === SPACE) { - $items[0].focus(); + next(() => { + $items[0].focus(); + }); return; } } diff --git a/ui-v2/app/components/popover-select/index.hbs b/ui-v2/app/components/popover-select/index.hbs index 364505d6dc..ce71b151aa 100644 --- a/ui-v2/app/components/popover-select/index.hbs +++ b/ui-v2/app/components/popover-select/index.hbs @@ -1,5 +1,5 @@
- + {{selected.value}}