primereact icon indicating copy to clipboard operation
primereact copied to clipboard

Accessibility: Stepper component uses invalid ARIA structure (tabpanel inside tablist)

Open likhuta91 opened this issue 2 months ago • 0 comments

Describe the bug

The Stepper component renders markup that violates ARIA structure requirements. It assigns role="tablist" to the root container, but places elements with role="tabpanel" inside it. According to the WAI-ARIA specification, a tablist element must contain only elements with role="tab" as direct children — not tabpanel.

As a result, accessibility testing tools (e.g., axe, jest-axe, or Playwright accessibility checks) report an error such as: aria-required-children: Element has children which are not allowed: [role=tabpanel]

Reproducer

https://stackblitz.com/edit/vitejs-vite-72fnfe5c?file=src%2FApp.tsx

System Information

System:
    OS: macOS 15.7.1
  Binaries:
    Node: 22.19.0 - /opt/homebrew/opt/node@22/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.9.3 - /opt/homebrew/opt/node@22/bin/npm
  Browsers:
    Chrome: 141.0.7390.123
    Safari: 26.0.1
  npmPackages:
    primereact: 10.9.7 => 10.9.7 
    react: ^18.3.1 => 18.3.1 
    tailwindcss: 3.4.3 => 3.4.3

Steps to reproduce the behavior

  1. Render a simple PrimeReact Stepper
  2. Inspect the generated DOM
  3. Run accessibility audit (e.g., with axe-core).

Current behavior

  • The root element (.p-stepper) uses role="tablist".
  • It contains child elements with role="tabpanel".
Image
  • This violates ARIA semantics and fails automated accessibility tests
Image

Expected behavior

The DOM structure should follow ARIA guidelines. Either:

  • Use a different container role (e.g. role="group" or role="list"), or
  • Move role="tabpanel" elements outside the tablist container.

likhuta91 avatar Oct 28 '25 14:10 likhuta91