Emit pane aria-controls only while the pane is mounted

This commit is contained in:
2026-06-07 23:11:32 +03:00
parent 1d7798abc5
commit cdd5cf149f
2 changed files with 19 additions and 5 deletions
+7 -5
View File
@@ -102,11 +102,13 @@ export function PaneToggleStrip() {
type="button"
aria-pressed={visible[item.pane]}
aria-label={item.label}
// TODO: when a pane is hidden, App unmounts its <section>, so this
// aria-controls IDREF dangles until the pane is shown again. Harmless
// (AT ignores unresolved IDREFs) but technically invalid — consider
// keeping the section mounted-but-hidden, or dropping aria-controls.
aria-controls={item.controls}
// Only point at the pane while it's actually mounted: App unmounts a
// hidden pane's <section>, so emitting aria-controls then would leave a
// dangling IDREF (invalid, even if AT ignores it). The association is
// meaningful only when the target exists, and the aria-pressed state
// already conveys hidden/shown either way (contract: arch/10 → toggle
// strip — the bullet lists aria-pressed + a stable name, not controls).
aria-controls={visible[item.pane] ? item.controls : undefined}
// Description (not the name): hints what activating does. The name stays
// stable (aria-label) per APG's toggle-button rule.
title={`${visible[item.pane] ? 'Hide' : 'Show'} ${item.label.toLowerCase()}`}