Skip to content

fix(breadcrumbs): consistent aria-current placement on content element (navigation-11)#3399

Merged
cixzhang merged 2 commits into
mainfrom
navi/fix/breadcrumb-aria-current
Jul 2, 2026
Merged

fix(breadcrumbs): consistent aria-current placement on content element (navigation-11)#3399
cixzhang merged 2 commits into
mainfrom
navi/fix/breadcrumb-aria-current

Conversation

@cixzhang

@cixzhang cixzhang commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Part of the accessibility & keyboard-management program (#3343). Fixes finding navigation-11.

Problem

Breadcrumb aria-current="page" placement was inconsistent:

  • The auto-detect effect (used when no item sets isCurrent) set aria-current on the outer <li> via setAttribute.
  • The explicit isCurrent path renders it on the inner content <span>.
  • And when the auto-detected last item is a link, the anchor never carried aria-current — so screen readers didn't announce the current page on the actual navigation element.

Fix

The auto-detect effect now targets the item's content element (the link/button/span rendered after the separator — the <li>'s last child), matching where the explicit path places it. aria-current lands on the anchor when the last item is a link, and never on the <li>.

Tests

Updates the auto-detect tests to assert placement on the content element (and that the <li> does not carry it), and adds a case for the last-item-is-a-link scenario (anchor carries aria-current). Full Breadcrumbs suite green (25 tests), typecheck + lint clean.

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 2, 2026 3:53pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.6KB 0B

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

github-actions Bot added a commit that referenced this pull request Jul 2, 2026
Comment thread packages/core/src/Breadcrumbs/BreadcrumbItem.tsx Outdated
@cixzhang cixzhang marked this pull request as ready for review July 2, 2026 18:47
@cixzhang cixzhang merged commit d4c4bfc into main Jul 2, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants