Skip to content

fix accessibility bug 2605237 a11y aria required children#3598

Open
navya9singh wants to merge 4 commits into
v2from
navya9singh/fix-2605237-a11y-aria-required-children
Open

fix accessibility bug 2605237 a11y aria required children#3598
navya9singh wants to merge 4 commits into
v2from
navya9singh/fix-2605237-a11y-aria-required-children

Conversation

@navya9singh

Copy link
Copy Markdown
Member

navya9singh and others added 4 commits June 29, 2026 11:21
…homepage

The 'Back' button in AboveTheFold.tsx and the 'Show code sample' button in
EditorExamples.tsx are <a href='#'> elements that trigger JS behavior without
navigating. Screen readers announced them as role=link, which is incorrect per
WCAG 4.1.2 (Name, Role, Value).

Added role='button' to both elements so assistive technologies correctly
identify them as interactive controls. This fixes accessibility bug 2492041
(A11y_TypeScript_HomePage_AI4W).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 'Try TypeScript Now' (index_2_cta_install) FluidButton calls
e.preventDefault() and shows the CTA links panel — it does not navigate.
Added role prop to FluidButton and passed role='button' at this call site.

Part of bug 2492041 (A11y_TypeScript_HomePage_AI4W, MAS 4.1.2).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bug: 2605237 - aria-required-children violation on ul[role=tablist]

Root cause: TopNav.tsx used role='tablist' on the <ul>, role='none
presentation' on each <li>, and aria-owns to reference inner <a role='tab'>
elements. This pattern is broken because:
  - role='none' is not honored when a descendant is focusable (<a href>)
  - axe-core 4.10.2 flags li[tabindex] as 'children not allowed' in tablist
  - aria-owns is redundant when elements are already DOM descendants
  - The IDs (tab1-tab6) are not referenced by any JavaScript

Fix: Remove role='tablist', aria-owns, aria-busy, role='none presentation',
and role='tab'. The <nav aria-label='top menu'> wrapper already provides
correct semantics. Gatsby's Link sets aria-current='page' on the active item.

Affects ALL pages (homepage, playground, docs, etc.) since TopNav is global.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Same broken pattern as TopNav: ul.editor-tabs used role='tablist' with
li[role='none presentation'] wrappers around a[role='tab'] elements.
role='none' is ignored by axe when descendants are focusable (<a href>),
so the li children were flagged as not allowed in a tablist.

Fix: give <li> elements role='tab' + aria-selected + tabIndex directly,
removing the inner <a> wrappers and the redundant aria-owns/aria-busy.
Update CSS to apply color/cursor directly to li instead of li > a.

This clears the aria-required-children axe violation on the homepage,
confirmed by axe-core 4.x programmatic FastPass check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@navya9singh navya9singh added the deploy-preview Enables automatic deployments to preview environments on a PR label Jun 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3598.centralus.5.azurestaticapps.net

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

Labels

deploy-preview Enables automatic deployments to preview environments on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant