Accesibility and keyboard navigation #3156
Replies: 2 comments 7 replies
-
Thanks for reporting. A11Y is a topic of great importance for Material for MkDocs, but I agree that some parts of the UI could use some work. You can open an issue if you like where we can collect A11Y issues. I can look into them when I find some time. Related: |
Beta Was this translation helpful? Give feedback.
-
I wrote a fix here: https://github.com/mnazzaro/mkdocs-material I added partials/javascripts/nav-item.html and updated partials/nav-item.html and base.html so that navigation labels would have accessibility tags and tabindex="0". Previously, they weren't tabbable. I also wrote some js so that when the user hits enter on the focused nav-item it expands. I'm not sure if the js I wrote belongs in a new partials/javascripts, but I couldn't find a better place to put it. The problem is that when I build, the script is replaced by <script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>. The temporary solution I used in my own project was just the stick the script at the bottom of the main.html override, and that works, but it doesn't seem like the right place to put it. I think this is very close, so I would appreciate some more eyes on it. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I am extremely happy with MkDocs and with the Material theme myself. I am trying to make my site as friendly and usable to the blind and visually impaired as possible. I met yesterday with someone from our university's accessibility group to look at a draft of our website to evaluate accessibility, and there were a few issues. The one that is of most concern to me now is that when the table of contents has subtopics, there doesn't seem to be a way to navigate to them via the keyboard; i.e., Tabbing to them.
To illustrate, make a site with just
mkdocs.yml
docs/text.md
Open the page in a browser, and try to Tab to the Subtopic. If the Topics item is expanded -- that is, Subtopic is visible -- you can Tab to it, whereas if the Topic is folded up -- that is, Subtopic is not visible -- I can find no way to get to Subtopic using the keyboard.
Is there a way to do that?
We would like to make our documentation functional for screen reading software and keyboard navigation without sacrificing the item headings in the Navigation bar.
Thank you for your time and for the great software!
Beta Was this translation helpful? Give feedback.
All reactions