Skip to content

Copying a code block tells screen reader users nothing #50

Description

@pushpam2404

Context

The Copy button confirms by changing its own visible text to "Copied". A screen reader will not announce that change, because nothing tells it to. A blind user presses the button and gets silence — with no way to know whether it worked.

What to change

Files: js/copy-code.js, and possibly the page markup

Requirements:

  • Announce success and failure through a polite live region
  • One shared live region is fine and is preferable to one per button
  • The failure path — where the label becomes "Press Ctrl+C" — needs announcing too
  • Do not make the announcement assertive; this does not warrant interrupting

Acceptance criteria

  • Copying announces something like "copied to clipboard"
  • Failing announces the fallback instruction
  • Nothing visual changes for sighted users
  • Verified with a real screen reader — VoiceOver on macOS is Command-F5

How to verify locally

python3 -m http.server 8000

Then open http://localhost:8000.

Difficulty

Intermediate. Please test with an actual screen reader rather than assuming.


New here? Comment /claim on this issue and a bot will assign it to you. Then read CONTRIBUTING.md.

Stuck at any point? Comment here saying what you have tried and where it stopped working — that is not an admission of failure, it is how we find out the instructions were unclear. You can also come to a PR Debug Clinic (Oct 12 or Oct 21).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityMaking the project usable by everyonebugSomething is brokendifficulty: intermediateRequires reading existing codedomain: os-devxOpen Source & Developer ExperiencehacktoberfestCounts toward Hacktoberfest 2026

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions