docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.47k stars 5.67k forks source link

Accessibility - scrollable code region should be focusable #2224

Closed kburk1997 closed 10 months ago

kburk1997 commented 1 year ago

Bug Report

Steps to reproduce

  1. Go to develop preview
  2. Scroll down until code samples are visible
  3. Shrink window size until scrollbars appear on code samples
  4. Run axe-devtools automated checker

    Current behaviour

Axe-devtools produces the following issue:

Scrollable region must have keyboard access

Ensure elements that have scrollable content are accessible by keyboard

Element Info

Element location:

pre[data-lang="js"][v-pre=""]:nth-child(10) > .lang-js

Element source:

<code class="lang-js">

Screenshot Screenshot of scrollable code snippet that is not focusable

About this issue:

Test Name: Docsify Preview Test URL: https://docsify-preview.vercel.app/#/configuration?id=homepage Impact: Serious Found on: 9/12/2023 at 10:54 am Found: Automatically Issue tags: cat.keyboard, wcag2a, wcag211, TTv5, TT4.a Help: Scrollable region must have keyboard access

Expected behaviour

Running axe-devtools should not produce the above error.

Code snippets should be scrollable so that keyboard-only users can read the code snippet's contents by scrolling.

Other relevant information

jhildenbiddle commented 11 months ago

Thanks for creating the issue, @kburk1997!

I've created a draft PR here: #2264. In that PR you will find a preview link which will allow you to review the changes:

CleanShot 2023-10-17 at 08 59 27@2x

Before I mark this PR as ready for review by the maintainers, I would love to get your thoughts and/or feedback.

Thanks!