Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3c74836
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 5, 2025
ac87b83
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 5, 2025
6a36817
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 5, 2025
065d2cd
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 5, 2025
d674097
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 5, 2025
135f65f
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 5, 2025
386e21f
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 5, 2025
1e3c536
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 8, 2025
c8db311
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 8, 2025
e2d27dc
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Aug 9, 2025
3c47a76
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 10, 2025
6a5d635
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 10, 2025
fd3fcfc
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 10, 2025
2ad8f86
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 16, 2025
b521864
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 16, 2025
a3286ae
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 16, 2025
9fd1f8e
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 16, 2025
ae39880
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 16, 2025
a7f2e9b
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 17, 2025
c391b72
chore: Update branch with latest `spinbutton-redesign` changes and su…
w3cgruntbot Sep 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Update branch with latest spinbutton-redesign changes and su…
…bmodule updates
  • Loading branch information
w3cgruntbot committed Sep 18, 2025
commit c8db31137e9372ff076c01bfe92197e4d923ca5c
4 changes: 0 additions & 4 deletions ARIA/apg/index/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,6 @@ if (enableSidebar) document.body.classList.add('has-sidebar');
</ul>
</td>
</tr>
<tr>
<td><code>status</code></td>
<td><a href="../patterns/spinbutton/examples/quantity-spinbutton/">Quantity Spin Button</a></td>
</tr>
<tr>
<td><code>switch</code></td>
<td>
Expand Down
27 changes: 12 additions & 15 deletions ARIA/apg/patterns/spinbutton/examples/quantity-spinbutton.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ if (enableSidebar) document.body.classList.add('has-sidebar');
<span aria-hidden="true">&plus;</span>
</button>
</div>
<div role="status"
for="adults"
<output for="adults"
data-self-destruct="2000"
class="visually-hidden"></div>
class="visually-hidden"></output>
</div>
<div class="spinner-field">
<label for="kids">
Expand Down Expand Up @@ -191,10 +190,9 @@ if (enableSidebar) document.body.classList.add('has-sidebar');
<span aria-hidden="true">&plus;</span>
</button>
</div>
<div role="status"
for="kids"
<output for="kids"
data-self-destruct="2000"
class="visually-hidden"></div>
class="visually-hidden"></output>
</div>
<div class="spinner-field">
<label for="animals">
Expand Down Expand Up @@ -230,10 +228,9 @@ if (enableSidebar) document.body.classList.add('has-sidebar');
<span aria-hidden="true">&plus;</span>
</button>
</div>
<div role="status"
for="animals"
<output for="animals"
data-self-destruct="2000"
class="visually-hidden"></div>
class="visually-hidden"></output>
</div>
</div>
</fieldset>
Expand Down Expand Up @@ -424,15 +421,15 @@ if (enableSidebar) document.body.classList.add('has-sidebar');
<td><code>span</code></td>
<td>For assistive technology users, hides the visible minus and plus characters in the increment and decrement buttons since they are symbolic of the superior button labels provided by the <code>title</code> attribute.</td>
</tr>
<tr data-test-id="status-role">
<th scope="row"><code>status</code></th>
<tr data-test-id="output">
<td></td>
<td><code>div</code></td>
<td></td>
<td><code>output</code></td>
<td>
<ul>
<li>Identifies the invisible <code>div</code> as a <code>status</code> element with an implicit <code>aria-live</code> value of <code>polite</code>.</li>
<li>Triggers a screen reader announcement of the <code>status</code> element’s updated content at the next graceful opportunity.</li>
<li>When either the increment or decrement button is pressed, the current value of the spin button is injected into the <code>status</code> element.</li>
<li>An element with an implicit role of <code>status</code> and an implicit <code>aria-live</code> value of <code>polite</code>.</li>
<li>Triggers a screen reader announcement of the <code>output</code> element’s updated content at the next graceful opportunity.</li>
<li>When either the increment or decrement button is pressed, the current value of the spin button is injected into the <code>output</code> element.</li>
<li>Its contents are emptied 2000 milliseconds after injection.</li>
</ul>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"separator","0","1","Example: Editor Menubar"
"slider","2","5","Guidance: Slider (Multi-Thumb) Pattern","Guidance: Slider Pattern","Example: Horizontal Multi-Thumb Slider","Example: Color Viewer Slider","Example: Rating Slider","Example: Media Seek Slider","Example: Vertical Temperature Slider"
"spinbutton","1","3","Guidance: Spinbutton Pattern","Example: (Deprecated) Date Picker Spin Button","Example: Quantity Spin Button","Example: Toolbar"
"status","0","1","Example: Quantity Spin Button"
"status","0","0"
"switch","1","3","Guidance: Switch Pattern","Example: Switch Using HTML Button","Example: Switch Using HTML Checkbox Input","Example: Switch"
"tab","1","4","Guidance: Keyboard Navigation Between Components (The Tab Sequence)","Example: Auto-Rotating Image Carousel with Tabs for Slide Control","Example: Experimental Tabs with Action Buttons","Example: Tabs with Automatic Activation","Example: Tabs with Manual Activation"
"table","2","1","Guidance: Table Pattern","Guidance: Grid and Table Properties","Example: Table"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SpinButton {
this.controls = Array.from(
document.querySelectorAll(`button[aria-controls="${this.id}"]`)
);
this.status = document.querySelector(`[role="status"][for="${this.id}"]`);
this.output = document.querySelector(`output[for="${this.id}"]`);
this.timer = null;
this.setBounds();
el.addEventListener('input', () => this.setValue(el.value));
Expand Down Expand Up @@ -72,13 +72,13 @@ class SpinButton {
}

announce() {
if (!this.status) return;
this.status.textContent = this.el.value;
if (!this.output) return;
this.output.textContent = this.el.value;
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.status.textContent = '';
this.output.textContent = '';
this.timer = null;
}, this.status.dataset.selfDestruct || 1000);
}, this.output.dataset.selfDestruct || 1000);
}

handleKey(e) {
Expand Down