Skip to content

a11y: scrollable code blocks and output pre lack tabindex=0 (keyboard inaccessible) #14378

@cderv

Description

@cderv

Reported in #14373.

Repro: https://github.com/alexpghayes/quarto-accessibility-reprex (post/post-1)

axe rule: scrollable-region-focusable · impact: serious · tag: wcag2a (2.1.1, 2.1.3)
Targets: <div class="sourceCode cell-code" id="cb...">, <pre> inside .cell-output

When code blocks or cell output overflow the viewport width they become scrollable, but Quarto doesn't add tabindex="0" — so keyboard-only users cannot scroll to see the hidden content. The fix should conditionally add tabindex="0" when the element's scrollWidth exceeds its clientWidth, or unconditionally for .sourceCode / .cell-output pre.

Part of #8706.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions