Skip to content

a11y(website): make scrollable code blocks keyboard accessible (WCAG 2.1.1) #400

@ajitpratap0

Description

@ajitpratap0

Problem

All <pre> / code blocks with overflow-x: auto are unreachable by keyboard — users cannot Tab to them to scroll horizontally. This violates WCAG 2.1.1 (Keyboard, Level A).

axe-core reported 1 affected node on homepage and 13 on the getting-started docs page.

Fix

Add tabIndex={0} to the outer element of the CodeBlock component in website/src/components/docs/mdx-components.tsx. Also fix the hero code block on the homepage.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions