[WICG/webcomponents] delegatesFocus and non-tabbable, focusable elements (Issue #977)

The `delegatesFocus` API doesn't provide a way to choose which element to bring into focus. It's always the first focusable element, meaning an element with tabindex="-1" (focusable, but removed from tabbing sequence) will be focused. But in my experience handling focus programmatically is often tied to keyboard focus considerations — mouse users don't really care where focus is, but it's essential for a user tabbing through the page. Bringing focus to a non tabbable element will cause issues for these users, so it seems to me `delegatesFocus` either needs to bring focus to the first *tabbable* element (rather than focusable), OR needs to have an option for specifying which element to bring into focus (not sure if there are cases where we'd want something else than the first tabbable element).

For context, the issue I'm having is with a [roving tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex) inside the shadow DOM.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/977

You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/977@github.com>

Received on Thursday, 1 December 2022 16:56:18 UTC