You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
a11y/select-name fails hidden and no-js selects: it does not use the shared hidden-control reader (#989 follow-up) #991
a11y/select-name (packages/rules/src/a11y/select-name.ts) checks every <select> on the page (doc.querySelectorAll("select")) and fails each one with no accessible name. It does not use the shared hidden-control reader (shared/static-hidden.ts) that the other naming checks use (a11y/form-labels, a11y/aria-input-field-name, a11y/button-name and the rest). So it also reports a select that is out of the accessibility tree:
one with the hidden attribute or aria-hidden="true";
The other checks skip such a select or report it as unconfirmed.
Repro
All runs use v0.0.125 (main ec70d7d) with Bun 1.4.0, against a local fixture. The page loads <link rel="stylesheet" href="/site.css"> and contains <form><select class="no-js" name="sort">…</select></form>.
a11y/form-labels: form-labels-unconfirmed (warn), with the reason "may hide it when JavaScript runs".
A <div class="no-js"> wrapper around the select gives the same split. This is the #989 production case: a product form's select[name="id"].no-js fallback, which the theme hides once scripts run. Fixing #989 leaves one check still failing it.
Acceptance Criteria
a11y/select-name reads visibility through shared/static-hidden.ts, like the other naming checks. A select that the hidden attribute, aria-hidden, a decided display: none or a closed dialog hides is skipped, and one a style may hide is select-name-unconfirmed (warn), not a fail.
A no-js select, or a select under a non-root no-js wrapper, on a page with an unread stylesheet is unconfirmed with the same "may be hidden when JavaScript runs" label as form-labels.
A visible unnamed select still fails, and a select on a page whose styles were all read keeps its verdict.
The rule's docs and fix text say how hidden selects are treated.
Activity
fix(rules): a11y/select-name reads visibility through the shared hidd…