From 3b77e6bdca731b2ee71d5f50fc86fba4fa8bd9b7 Mon Sep 17 00:00:00 2001 From: Jacques Newman Date: Thu, 18 Sep 2025 18:08:55 -0700 Subject: [PATCH 1/6] Add key-conflict explanation and escape mechanism. Add small section on how this interacts with scrolling. Update date. --- .../scoped-focusgroup.explainer.mdx | 135 +++++++++++++----- 1 file changed, 99 insertions(+), 36 deletions(-) diff --git a/site/src/pages/components/scoped-focusgroup.explainer.mdx b/site/src/pages/components/scoped-focusgroup.explainer.mdx index c0370ca97..91a3d9145 100644 --- a/site/src/pages/components/scoped-focusgroup.explainer.mdx +++ b/site/src/pages/components/scoped-focusgroup.explainer.mdx @@ -8,7 +8,7 @@ layout: ../../layouts/ComponentLayout.astro - Authors: [Jacques Newman](https://github.com/janewman) - Prior contributors (from the earlier, broader [focusgroup explainer](/components/focusgroup.explainer)): [Travis Leithead](https://github.com/travisleithead), [David Zearing](https://github.com/dzearing), [Chris Holt](https://github.com/chrisdholt) - WHATWG issue: https://github.com/whatwg/html/issues/11641 - - Last updated: 2025-09-18 + - Last updated: 2025-09-25 ## Table of Contents @@ -31,6 +31,9 @@ layout: ../../layouts/ComponentLayout.astro - [Shadow DOM boundaries](#shadow-dom-boundaries) - [Key conflicts](#key-conflicts) - [Interactive content inside focusgroups](#interactive-content-inside-focusgroups) + - [Key conflict elements](#key-conflict-elements) + - [Determining key conflict elements](#determining-key-conflict-elements) + - [Scrolling interactions](#scrolling-interactions) - [Restricted elements](#restricted-elements) - [Feature detection](#feature-detection) - [Additional features](#additional-features) @@ -608,48 +611,102 @@ sure users can "escape" these elements. Built-in elements provide this via the t strategies might include requiring an "activation" step before putting focus into the interactive control (and an Esc key exit to leave). -The focusgroup's [memory](#last-focused-memory) may also cause unexpected user interactions if -authors are not careful. For example, without any author mitigations, an interactive control inside -a focusgroup may inadvertently prevent the user from accessing other focusgroup items: +#### Key conflict elements + +When there is a conflict between the arrow keys consumed by the interactive element and the focusgroup's navigation, focusgroup will **not** interfere with the interactive element's behavior. This means that the normal way to move focus between focusgroup items (arrow keys) will **not** work when focus is within such an element. + +Examples: +- `` elements (most, but not all types use arrow keys) +- `