From 6398186d051f1b7fa309dad28a04d49ab2b4329e Mon Sep 17 00:00:00 2001 From: Material Web Team Date: Wed, 22 Mar 2023 19:00:58 -0700 Subject: [PATCH] fix(list): fix strong focus first keyboard nav fixes an issue where first keyboard navigation would not show strong focus because event listeners flush the event queue and the keyboard event doesn't reach window before focus is called PiperOrigin-RevId: 518731054 --- list/lib/list.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/list/lib/list.ts b/list/lib/list.ts index e8e2a4dbbf..e181113745 100644 --- a/list/lib/list.ts +++ b/list/lib/list.ts @@ -13,6 +13,7 @@ import {ClassInfo, classMap} from 'lit/directives/class-map.js'; import {ifDefined} from 'lit/directives/if-defined.js'; import {ariaProperty} from '../../decorators/aria-property.js'; +import {keydownHandler} from '../../focus/strong-focus.js'; import {ARIARole} from '../../types/aria.js'; import {ListItem} from './listitem/list-item.js'; @@ -129,6 +130,7 @@ export class List extends LitElement { activeItemRecord.item.active = false; } + keydownHandler(event); event.preventDefault(); switch (key) {