-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH - Make code blocks focusable #1100
Comments
pre
elements focusable
Looking into this today, I realized that we have two problems to fix:
So even if we fix (1), a keyboard user won't be able to scroll, for example, code blocks with long lines, using the left-right arrow keys. But isn't that the point of making scrollable regions focusable? -> so that a keyboard user can focus the code block then scroll the content in the block using just the keyboard? |
Forgot to mention, the site intercepts the left and right arrow keys in order to navigate to the previous/next pages from the current page in the documentation. Tania and I have chatted about this before. Probably a violation of WCAG 2.1.4 - Character Key Shortcuts (Level A) |
I should also mention that the first time I encountered the left/right arrow key behavior in the PST docs, I was taken by surprise. I'm really not used to websites using those as keyboard shortcuts to navigate from one page to another. |
Digging into this, the most relevant PR I could find was #87, which removed some custom JS in favor of using Sphinx theme.conf |
Pinging @choldgraf, since he authored #87 |
looking at the sphinx gallery of themes, the only one using this functionality are:
|
I disable it on my sites, but I have no idea how many sites out there set it to |
Agree with @drammock - seems the best would be to set this to False and add a proper depreciation notice/warning/process. |
+1 to defaulting to false. IMO we should go with whatever is the gold standard for keyboard based interaction , and not feel too constrained by previous functionality |
Right now, the code blocks (
highlight
) are not focusable, which makes them hard to navigate or inaccessible to readers using only their keyboards or screenreaders.This can be fixed by ensuring the elements have a
tabindex="0"
.See an example of a focusable code block from gov.uk
Jan-05-2023.19-02-59.mp4
Originally posted by @trallard in #1095 (comment) -> the effort to add a
max-height
and scrollbar and making thepre
elements focusable are independent.And since I opened this and have been making plenty of noise, I will send a PR tomorrow.
The text was updated successfully, but these errors were encountered: