Skip to content

fix(theme-classic): remove redundant title attribute from sidebar CategoryLinkLabel#12064

Open
AkshatRaj00 wants to merge 1 commit into
facebook:mainfrom
AkshatRaj00:fix/sidebar-redundant-title-accessibility
Open

fix(theme-classic): remove redundant title attribute from sidebar CategoryLinkLabel#12064
AkshatRaj00 wants to merge 1 commit into
facebook:mainfrom
AkshatRaj00:fix/sidebar-redundant-title-accessibility

Conversation

@AkshatRaj00
Copy link
Copy Markdown

Summary

Fixes #11945

Problem

The CategoryLinkLabel component in DocSidebarItem/Category/index.tsx renders a <span> with a title attribute whose value is identical to the visible text content:

// Before (problematic)
function CategoryLinkLabel({label}: {label: string}) {
  return (
    <span title={label} className={styles.categoryLinkLabel}>
      {label}
    </span>
  );
}

This causes accessibility tools like WAVE to flag a "Redundant title text" alert on every sidebar category item, as reported in #11945. The title tooltip conveys zero additional information over the visible label text.

This also affects Windows Voice Access users — the tool shows two numbers for the same control when issuing "Show Numbers" command, because the duplicate title creates an extra accessible name target (as seen in #11646).

Fix

Remove the title={label} prop from CategoryLinkLabel. The visible text is already sufficient for all assistive technologies including screen readers, voice control, and keyboard navigation.

// After (fixed)
function CategoryLinkLabel({label}: {label: string}) {
  // title attribute omitted — visible label text is sufficient.
  // See: https://github.com/facebook/docusaurus/issues/11945
  return (
    <span className={styles.categoryLinkLabel}>
      {label}
    </span>
  );
}

Impact

Testing

  • Verified WAVE no longer shows redundant title alert after the fix
  • Sidebar expand/collapse behavior unchanged
  • Screen reader (NVDA) reads category labels correctly without duplication
  • No TypeScript errors

Related Issues

…egoryLinkLabel

The `title` attribute on `<span>` inside CategoryLinkLabel was identical
to the visible text content. This caused WAVE accessibility tool to flag
a "Redundant title text" alert on all sidebar category items.

For users relying on voice access or screen readers, having a tooltip
that duplicates the visible label provides no additional context and adds
noise to the accessibility tree.

Fix: Remove the `title={label}` prop from the CategoryLinkLabel span.
The visible label text is sufficient for all assistive technologies.

Fixes facebook#11945
@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label May 23, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 23, 2026

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit cfa33c1
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6a11ff537b840000082ab200
😎 Deploy Preview https://deploy-preview-12064--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility: Reduntant title text in sidebar

1 participant