fix accessibility bug 2605237 a11y aria required children#3598
Open
navya9singh wants to merge 4 commits into
Open
fix accessibility bug 2605237 a11y aria required children#3598navya9singh wants to merge 4 commits into
navya9singh wants to merge 4 commits into
Conversation
…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>
Contributor
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3598.centralus.5.azurestaticapps.net |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2605237