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.
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-outputWhen 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 addtabindex="0"when the element's scrollWidth exceeds its clientWidth, or unconditionally for.sourceCode/.cell-output pre.Part of #8706.