mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Emit pane aria-controls only while the pane is mounted
This commit is contained in:
@@ -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()}`}
|
||||
|
||||
Reference in New Issue
Block a user