Skip to content

Commit 1dd6f8c

Browse files
Add IDs to section headers for improved accessibility in focusgroup demos
1 parent 1faefae commit 1dd6f8c

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed

focusgroup/accordion.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h1>Accordion Pattern</h1>
2525
<!-- Demo 1: Accordion -->
2626
<!-- ============================================================ -->
2727
<section class="demo-section">
28-
<h2>Accordion with Opt-Out Panels</h2>
28+
<h2 id="accordion-with-opt-out-panels">Accordion with Opt-Out Panels</h2>
2929
<p>
3030
Up/Down arrows navigate between accordion headers. Panel
3131
content is <strong>opted out</strong>
@@ -162,7 +162,7 @@ <h3><button type="button" aria-expanded="false" aria-controls="acc-panel4">Secti
162162
<!-- Demo 2: Long Content Mitigation -->
163163
<!-- ============================================================ -->
164164
<section class="demo-section">
165-
<h2>Long Content: A Possible Mitigation</h2>
165+
<h2 id="long-content-a-possible-mitigation">Long Content: A Possible Mitigation</h2>
166166
<p>
167167
Because focusgroup arrow keys jump directly between headers,
168168
<strong>long panel content
@@ -363,7 +363,7 @@ <h3><button type="button" aria-expanded="false" aria-controls="long-panel3">When
363363
</section>
364364

365365
<section class="demo-section">
366-
<h2>Key Point: <code>focusgroup="none"</code></h2>
366+
<h2 id="key-point-focusgroup-none">Key Point: <code>focusgroup="none"</code></h2>
367367
<p>
368368
The <code>none</code> value opts an element and its subtree out
369369
of the ancestor focusgroup.

focusgroup/additional-concepts.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h1>Additional Concepts</h1>
2424
<!-- Demo 1: Nested Focusgroups -->
2525
<!-- ============================================================ -->
2626
<section class="demo-section">
27-
<h2>Nested Focusgroups</h2>
27+
<h2 id="nested-focusgroups">Nested Focusgroups</h2>
2828
<p>
2929
A nested focusgroup creates an independent navigation scope
3030
within an outer focusgroup.
@@ -88,7 +88,7 @@ <h2>Nested Focusgroups</h2>
8888
<!-- Demo 2: Opt-out with focusgroup="none" -->
8989
<!-- ============================================================ -->
9090
<section class="demo-section">
91-
<h2>Opt-Out Segments with <code>focusgroup="none"</code></h2>
91+
<h2 id="opt-out-segments-with-focusgroup-none">Opt-Out Segments with <code>focusgroup="none"</code></h2>
9292
<p>
9393
Use <code>focusgroup="none"</code> to exclude specific elements
9494
from arrow navigation
@@ -147,7 +147,7 @@ <h2>Opt-Out Segments with <code>focusgroup="none"</code></h2>
147147
<!-- Demo 3: Deep Descendant Discovery -->
148148
<!-- ============================================================ -->
149149
<section class="demo-section">
150-
<h2>Deep Descendant Discovery</h2>
150+
<h2 id="deep-descendant-discovery">Deep Descendant Discovery</h2>
151151
<p>
152152
Focusgroup items don't need to be direct children. The browser
153153
discovers focusable
@@ -201,7 +201,7 @@ <h2>Deep Descendant Discovery</h2>
201201
<!-- Demo 4: CSS reading-flow Integration -->
202202
<!-- ============================================================ -->
203203
<section class="demo-section">
204-
<h2>CSS <code>reading-flow</code> Integration</h2>
204+
<h2 id="css-reading-flow-integration">CSS <code>reading-flow</code> Integration</h2>
205205
<p>
206206
When CSS changes the visual order (e.g., <code>flex-direction:
207207
row-reverse</code>),
@@ -256,7 +256,7 @@ <h2>CSS <code>reading-flow</code> Integration</h2>
256256
<!-- Demo 5: Feature Detection -->
257257
<!-- ============================================================ -->
258258
<section class="demo-section">
259-
<h2>Feature Detection</h2>
259+
<h2 id="feature-detection">Feature Detection</h2>
260260
<p>
261261
Check whether the browser supports <code>focusgroup</code>
262262
before relying on it.

focusgroup/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h1>Focusgroup: Interactive Demos</h1>
2222
unsupported -->
2323

2424
<section class="demo-section">
25-
<h2>What is <code>focusgroup</code>?</h2>
25+
<h2 id="what-is-focusgroup">What is <code>focusgroup</code>?</h2>
2626
<p>
2727
The <code>focusgroup</code> HTML attribute lets you add
2828
arrow-key navigation to groups of
@@ -56,7 +56,7 @@ <h2>What is <code>focusgroup</code>?</h2>
5656
</section>
5757

5858
<section class="demo-section">
59-
<h2>Quick Demo: Try It Now</h2>
59+
<h2 id="quick-demo-try-it-now">Quick Demo: Try It Now</h2>
6060
<p>Click on the first button below, then use <kbd></kbd>
6161
<kbd></kbd> arrow keys to navigate. Press <kbd>Tab</kbd> to
6262
exit.
@@ -82,7 +82,7 @@ <h2>Quick Demo: Try It Now</h2>
8282
</section>
8383

8484
<section class="demo-section">
85-
<h2>Explore the Demos</h2>
85+
<h2 id="explore-the-demos">Explore the Demos</h2>
8686
<p>Each demo page showcases a specific UI pattern with interactive
8787
examples and source code.</p>
8888
<nav aria-label="Explore the Demos">
@@ -154,7 +154,7 @@ <h3>Additional Concepts</h3>
154154
</section>
155155

156156
<section class="demo-section">
157-
<h2>Resources</h2>
157+
<h2 id="resources">Resources</h2>
158158
<ul>
159159
<li><a href="https://open-ui.org/components/scoped-focusgroup.explainer/">
160160
Scoped Focusgroup Explainer
@@ -168,7 +168,7 @@ <h2>Resources</h2>
168168
</section>
169169

170170
<section class="demo-section">
171-
<h2>Browser Support</h2>
171+
<h2 id="browser-support">Browser Support</h2>
172172
<p>
173173
The <code>focusgroup</code> attribute is an
174174
<strong>experimental feature</strong>. At the time

focusgroup/listbox.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h1>Listbox Pattern</h1>
2525
<!-- Demo 1: Basic Listbox -->
2626
<!-- ============================================================ -->
2727
<section class="demo-section">
28-
<h2>Single-Select Listbox</h2>
28+
<h2 id="single-select-listbox">Single-Select Listbox</h2>
2929
<p>
3030
A selectable list of options with Up/Down arrow navigation.
3131
Click or press
@@ -91,7 +91,7 @@ <h2>Single-Select Listbox</h2>
9191
<!-- Demo 2: Listbox with wrapping -->
9292
<!-- ============================================================ -->
9393
<section class="demo-section">
94-
<h2>Listbox with Wrapping</h2>
94+
<h2 id="listbox-with-wrapping">Listbox with Wrapping</h2>
9595
<p>Adding <code>wrap</code> allows navigation to wrap from the last
9696
item back to the first (and vice versa).</p>
9797
<div class="attr-label">focusgroup="listbox block wrap"</div>

focusgroup/menu.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h1>Menu &amp; Menubar Pattern</h1>
2424
<!-- Demo 1: Simple Vertical Menu -->
2525
<!-- ============================================================ -->
2626
<section class="demo-section">
27-
<h2>Simple Vertical Menu</h2>
27+
<h2 id="simple-vertical-menu">Simple Vertical Menu</h2>
2828
<p>A basic vertical menu with Up/Down arrow navigation.</p>
2929
<div class="attr-label">focusgroup="menu block"</div>
3030

@@ -65,7 +65,7 @@ <h2>Simple Vertical Menu</h2>
6565
<!-- Demo 2: Menubar with Popover Submenus -->
6666
<!-- ============================================================ -->
6767
<section class="demo-section">
68-
<h2>Menubar with Popover Submenus</h2>
68+
<h2 id="menubar-with-popover-submenus">Menubar with Popover Submenus</h2>
6969
<p>
7070
A horizontal menubar using <code>inline</code> for Left/Right
7171
navigation between top-level items.
@@ -161,7 +161,7 @@ <h2>Menubar with Popover Submenus</h2>
161161
</section>
162162

163163
<section class="demo-section">
164-
<h2>Key Point: Independent Nested Scopes</h2>
164+
<h2 id="key-points-independent-nested-scopes">Key Point: Independent Nested Scopes</h2>
165165
<p>
166166
When a focusgroup is nested inside another, they are
167167
<strong>completely independent</strong>.

focusgroup/radiogroup.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h1>Radio Group Pattern</h1>
2525
<!-- Comparison: Native vs. Focusgroup Radio Group -->
2626
<!-- ============================================================ -->
2727
<section class="demo-section">
28-
<h2>Comparison: Native vs. Focusgroup</h2>
28+
<h2 id="comparison-native-vs-focusgroup">Comparison: Native vs. Focusgroup</h2>
2929
<p>
3030
Side-by-side comparison showing that a <code>focusgroup</code>
3131
radio group
@@ -102,7 +102,7 @@ <h3>Focusgroup Radio Group</h3>
102102
</section>
103103

104104
<section class="demo-section">
105-
<h2>Key Point: Navigation ≠ Selection</h2>
105+
<h2 id="key-point-navigation-selection">Key Point: Navigation ≠ Selection</h2>
106106
<p>
107107
With native <code>&lt;input type="radio"&gt;</code>, moving
108108
focus with arrows also selects the option.

focusgroup/tablist.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h1>Tablist Pattern</h1>
2424
<!-- Demo 1: Horizontal Tablist -->
2525
<!-- ============================================================ -->
2626
<section class="demo-section">
27-
<h2>Horizontal Tablist with Wrapping</h2>
27+
<h2 id="horizontal-tablist-with-wrapping">Horizontal Tablist with Wrapping</h2>
2828
<p>
2929
A tab control using <code>focusgroup</code> for arrow-key
3030
navigation. The <code>wrap</code>
@@ -124,7 +124,7 @@ <h3>FAQ</h3>
124124
<!-- Demo 2: Vertical Tablist -->
125125
<!-- ============================================================ -->
126126
<section class="demo-section">
127-
<h2>Vertical Tablist</h2>
127+
<h2 id="vertical-tablist">Vertical Tablist</h2>
128128
<p>A vertical tablist using <code>block</code> axis for Up/Down
129129
arrow navigation.</p>
130130
<div class="attr-label">focusgroup="tablist block wrap
@@ -198,7 +198,7 @@ <h3>Advanced Settings</h3>
198198
<!-- Demo 3: Long Content Mitigation -->
199199
<!-- ============================================================ -->
200200
<section class="demo-section">
201-
<h2>Long Content: A Possible Mitigation</h2>
201+
<h2 id="long-content-a-possible-mitigation">Long Content: A Possible Mitigation</h2>
202202
<p>
203203
Because tabs use selection-follows-focus, <strong>arrowing
204204
between tabs instantly
@@ -360,7 +360,7 @@ <h3>When To Use This Pattern</h3>
360360
</section>
361361

362362
<section class="demo-section">
363-
<h2>Key Point: Navigation vs. Selection</h2>
363+
<h2 id="key-point-navigation-vs-selection">Key Point: Navigation vs. Selection</h2>
364364
<p>
365365
<code>focusgroup</code> handles <strong>keyboard navigation
366366
only</strong>. It does not manage

focusgroup/toolbar.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h1>Toolbar Pattern</h1>
2525
<!-- Demo 1: Basic Toolbar -->
2626
<!-- ============================================================ -->
2727
<section class="demo-section">
28-
<h2>Basic Toolbar</h2>
28+
<h2 id="basic-toolbar">Basic Toolbar</h2>
2929
<p>A simple horizontal toolbar. All buttons are natively focusable
3030
<code>focusgroup</code> makes the group a single tab stop
3131
with arrow-key navigation.</p>
@@ -71,7 +71,7 @@ <h2>Basic Toolbar</h2>
7171
<!-- Demo 2: No Tabindex Needed -->
7272
<!-- ============================================================ -->
7373
<section class="demo-section">
74-
<h2>No <code>tabindex</code> Management Needed</h2>
74+
<h2 id="no-tabindex-management-needed">No <code>tabindex</code> Management Needed</h2>
7575
<p>With <code>focusgroup</code>, you don't need to set or manage
7676
<code>tabindex</code> on any items. The browser automatically
7777
collapses all focusable children into a single tab stop — no
@@ -122,7 +122,7 @@ <h2>No <code>tabindex</code> Management Needed</h2>
122122
<!-- Demo 3: Entry Point with focusgroupstart -->
123123
<!-- ============================================================ -->
124124
<section class="demo-section">
125-
<h2>Entry Point with <code>focusgroupstart</code></h2>
125+
<h2 id="entry-point-with-focusgroupstart">Entry Point with <code>focusgroupstart</code></h2>
126126
<p>The <code>focusgroupstart</code> attribute marks which element
127127
receives focus when you Tab into the group. Both Tab and
128128
Shift+Tab land on this element.</p>
@@ -167,7 +167,7 @@ <h2>Entry Point with <code>focusgroupstart</code></h2>
167167
<!-- Demo 4: Vertical Toolbar -->
168168
<!-- ============================================================ -->
169169
<section class="demo-section">
170-
<h2>Vertical Toolbar</h2>
170+
<h2 id="vertical-toolbar">Vertical Toolbar</h2>
171171
<p>Use <code>block</code> instead of <code>inline</code> to
172172
restrict navigation to the vertical axis (Up/Down arrows
173173
only).</p>

0 commit comments

Comments
 (0)