a11y: make the sidebar button a <button>#14326
a11y: make the sidebar button a <button>#14326hugovk wants to merge 3 commits intosphinx-doc:masterfrom
<button>#14326Conversation
|
The ty and 3.15 failures are unrelated and also occur in |
gastmaier
left a comment
There was a problem hiding this comment.
Welcome change, useful for both keyboard savvys and people with disabilities :)
timhoffm
left a comment
There was a problem hiding this comment.
This is fundamentally reasonable. However, it is a breaking change for downstream templates.
This will beak users who have styled the button with a div#sidebarbutton CSS filter, e.g. https://github.com/search?q=div%23sidebarbutton+language%3ACSS+NOT+is%3Afork&type=code
This needs a prominent change note and advice to change the style filter to #sidebarbutton.
|
Added! I put 9.2.0 as the version, but I don't mind if this needs a major bump. Some other semantic improvements have been done as bug fixes: #13689. |
themavik
left a comment
There was a problem hiding this comment.
nit: add type="button" on #sidebarbutton so it does not default to submit if this block ever sits inside a <form>.
Purpose
The sidebar button should be a semantic
<button>and not a<div>.This is needed for accessibility via keyboard and assistive technology.
For example, try this before and after this fix:
Then press tab repeatedly.
Before, the
<div>"button" can not be selected: _build-master.zipAfter, the real
<button>can be selected, and you can press space to open and close the side menu: _build-fixed.zipReferences