Skip to content

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

Closed

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.

Activity

  1. cwickham commented on Aug 7, 2026

    @cwickham
    Member

    This violation also applies to .cell-output-display, the container for rendered cell output (tables, SVGs, widgets).

    At a 390 px viewport, a 10-column kable() is enough:

    ---
    title: "scrollable-region-focusable on cell-output-display"
    format:
      html:
        axe: true
    ---
    
    ```{r}
    knitr::kable(
      mtcars[1:6, 1:10]
    )
    ```

    axe 4.10 reports (Quarto 1.10.18, 390×844 viewport):

    {
      "id": "scrollable-region-focusable",
      "impact": "serious",
      "tags": ["cat.keyboard", "wcag2a", "wcag211", "wcag213", "TTv5", "TT4.a", "EN-301-549", "EN-9.2.1.1", "EN-9.2.1.3"],
      "description": "Ensure elements that have scrollable content are accessible by keyboard",
      "help": "Scrollable region must have keyboard access",
      "helpUrl": "https://dequeuniversity.com/rules/axe/4.10/scrollable-region-focusable?application=axeAPI",
      "nodes": [
        {
          "impact": "serious",
          "html": "<div class=\"cell-output-display\">",
          "target": [".cell-output-display"],
          "failureSummary": "Fix any of the following:\n  Element should have focusable content\n  Element should be focusable"
        }
      ]
    }
  2. added a commit that references this issue on Oct 6, 2026
    9717306
  3. added this to the v1.11 milestone on Oct 19, 2026
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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions