Skip to content

a11y/aria-required-children ignores implicit role of native radio inputs in role=radiogroup #435

Closed

Description

@deniskern

Summary

a11y/aria-required-children reports div[role="radiogroup"]: needs child with role=radio when the group contains native <input type="radio"> elements. A native radio input has the implicit ARIA role radio (HTML-AAM / ARIA in HTML), so the required owned element is present. The rule only seems to accept an explicit role="radio" attribute.

axe-core accepts this markup: its aria-required-children check resolves implicit roles.

Reproduce

Tested with v0.0.99 (darwin-arm64).

  1. Save as index.html:
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>Radiogroup repro</title></head>
<body><main><h1>Variant picker</h1>
<div role="radiogroup" aria-label="Size">
  <div><input type="radio" id="s" name="size" value="s"><label for="s">S</label></div>
  <div><input type="radio" id="m" name="size" value="m"><label for="m">M</label></div>
</div>
</main></body></html>
  1. Serve it: python3 -m http.server 8796
  2. Run: squirrel audit http://127.0.0.1:8796/ --http -f json

Actual

a11y/aria-required-children fails with div[role="radiogroup"]: needs child with role=radio.

Expected

No finding: elements with an implicit role (input[type=radio] → radio, li → listitem, option → option, …) count as the required children, including when nested inside generic wrappers like <div>.

Activity

  1. added
    bug
    P2
    size: S
    rules
    on Oct 1, 2026
  2. nc9 commented on Oct 1, 2026

    @nc9
    Contributor

    Thanks, confirmed. The rule only accepts an explicit role attribute. The fix resolves implicit roles from native elements (radio, checkbox, option, li, tr, td and the rest of the html-aam mappings the required-children table can need), not just radio. Your markup is the regression fixture. It ships with #434 in the next release.

  3. nc9 commented on Oct 1, 2026

    @nc9
    Contributor

    Fixed in #438 (e4255c0): implicit ARIA roles from native elements now satisfy required children. Ships in the next CLI release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2bugrulessize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions