Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

a11y: search button accessible name does not contain its visible label (WCAG 2.5.3)

Open
#1,618 7 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #1631 by @hivecommons-hive — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
39/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript

Research direction

Read the navbar search rendering in docusaurus-plugin-search-local and the site's existing Footer swizzle under src/theme/. Compare the button's visible text and aria-label, then choose an upstream plugin fix or a local SearchBar swizzle. When the label includes the visible text, remove the NAVBAR_VIOLATIONS baseline entry from tests/e2e/accessibility.spec.js and confirm its retirement checks pass.

Written by the indexing model from the issue text.

Description

bug hive/claimed-by-scanner needs-human stage/045-needs-decision

Finding

docusaurus-plugin-search-local (2.1.2) renders the navbar search button as:

<button class="DocSearch DocSearch-Button" aria-label="Search (Control+k)" aria-keyshortcuts="Control+k">
  <span class="DocSearch-Button-Placeholder">Search</span>
  <span class="DocSearch-Button-Keys"><span><svg .../></span><span>K</span></span>
</button>

Visible text is "Search K" (the Control key is an icon); the accessible name is "Search (Control+k)". The accessible name does not contain the visible label, which fails WCAG 2.5.3 Label in Name. axe-core reports it as label-content-name-mismatch (serious).

Why it surfaced now

axe-core 4.14.0 removed the experimental tag from label-content-name-mismatch, so it runs under wcag21a for the first time. Dependabot's bump in #1606 therefore failed tests/e2e/accessibility.spec.js on all 20 routes and both profile-dialog states. The button was non-conformant before; the scanner just could not see it.

Current state

#1606 carries the bump plus a NAVBAR_VIOLATIONS baseline entry in KNOWN_VIOLATIONS / KNOWN_STATE_VIOLATIONS. The spec's retirement tests fail as soon as the rule stops firing, so the baseline cannot outlive the fix.

Fix options

The plugin's SearchBar renders SearchButton without passing translations, so neither buttonText nor buttonAriaLabel can be changed from docusaurus.config.js. Realistic paths:

  1. Upstream fix in docusaurus-plugin-search-local (make the aria-label contain the visible text, e.g. Search with the shortcut carried only by aria-keyshortcuts), then bump.
  2. Swizzle the plugin's SearchBar theme component into src/theme/ (the site already wraps Footer) and render the button with a conforming label.
  3. Rendering the Control key as text rather than an icon does not help: "Search Ctrl K" is still not a substring of "Search (Control+k)".

When the fix lands, delete the NAVBAR_VIOLATIONS entry in tests/e2e/accessibility.spec.js; the retirement tests will insist on it.

Scope note for the hive

The baseline is the designed mechanism in the spec and is already in place. The remaining work is a production change (option 1 or 2), not a test change.

Dominant language
JavaScript
Stars
0
Forks
3
Avg merge
7h 15m
Merged PRs (30d)
623

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/endusers

All issues in cncf/endusers

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.