json-schema-org / json-schema-org/website

🐛 Bug: Replace non-semantic interactive <div> elements with <button> in Layout component

Open Beginner friendly
#2,150 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Stale Status: Triage
Dominant language
HTML
Stars
169
Forks
484
Avg merge
2d 2h
Merged PRs (30d)
6

Description

Description

Several interactive elements in the Layout.tsx component are currently implemented using <div> tags with onClick handlers. This makes them inaccessible to keyboard users and screen readers, as <div> elements are not focusable by default and do not convey an interactive role to assistive technology.

Affected File:

components/Layout.tsx
Lines: 242-244, 248, 252, 265

Expected behavior

Interactive elements should use semantic HTML—specifically tags—to ensure they are:

  • Focusable via keyboard (using the Tab key).
  • Activatable using the Enter or Space keys.
  • Correctly announced as buttons by screen readers.
fix

Refactor these elements to use <button> tags and ensure they have descriptive aria-label attributes.
Example Refactor:

<button
  onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}
  aria-label="Scroll to top and search"
  className="..." // Ensure existing styles are preserved or updated for button defaults
>
  <Search />
</button>

Contributor guide

Open the contributing guide

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.

Research direction

Start in components/Layout.tsx at lines 242-244, 248, 252, and 265, and inspect the interactive div elements and their onClick handlers. Replace them with semantic button elements, add descriptive aria-label attributes, and preserve or adjust existing styles for button defaults. Done means the controls are keyboard-focusable, work with Enter and Space, and are announced as buttons by screen readers.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.