Skip to content

Commit 39d0c7f

Browse files
committed
Fix: A/B slot toggle had no visible active state
The button rendered class.active but not the data-slot attribute the CSS selector keyed off (.slot-btn[data-slot="A"].active), so the colored background never applied and both buttons looked identical. Add data-slot + aria-pressed for assistive tech.
1 parent e293ba1 commit 39d0c7f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ui/App.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ const shortLabel = (n: string): string => CURVE_SHORT[n] ?? n;
5353
const SlotToggle = (): Renderable => html`
5454
<div class="slot-toggle" role="tablist">
5555
${(["A", "B"] as const).map((slot) => html`
56-
<button type="button"
56+
<button type="button" data-slot=${slot}
57+
aria-pressed=${activeSlot.value === slot ? "true" : "false"}
5758
class=${`slot-btn ${activeSlot.value === slot ? "active" : ""}`}
5859
onClick=${() => (activeSlot.value = slot)}>${slot}</button>`)}
5960
</div>`;

0 commit comments

Comments
 (0)