Repository navigation
Make Reveal.js chalkboard buttons keyboard accessible - #15436
Merged
cderv merged 1 commit intoNov 30, 2026
Merged
Conversation
The "Toggle Chalkboard" and "Toggle Notes Canvas" controls were <span> elements with an onclick handler, so they could not be reached with Tab, operated with Enter or Space, or announced as buttons. Build them as <button type="button"> elements with an aria-label, aria-keyshortcuts and a stable class each, hide the icon from assistive technology, and stop Enter/Space from reaching reveal.js's document key handler so Space activates the button instead of advancing the slide. The CSS resets the native button styling so the visuals stay the same. Fixes quarto-dev#15428
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
cderv
approved these changes
Nov 30, 2026
cderv
left a comment
Member
There was a problem hiding this comment.
Thank you. This is good change !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #15428.
With
chalkboard: true,addChalkboardButtonsinplugins/support/support.jsbuilt "Toggle Chalkboard (b)" and "Toggle Notes Canvas (c)" as<span>elements with anonclickhandler. They could not be reached with Tab, could not be operated with Enter or Space, and screen readers did not announce them as buttons.This PR:
<button type="button">with anaria-label("Toggle Chalkboard", "Toggle Notes Canvas"),aria-keyshortcuts(b,c), the sametitletooltip as before, and a stable class (chalkboard-toggle-chalkboard,chalkboard-toggle-notes-canvas);aria-hidden="true";footer.css(border,padding,background,font,color,line-height) so the buttons look the same as before.Changelog entry added under Accessibility in
news/changelog-1.12.md.Tests
New Playwright tests in
tests/integration/playwright/tests/revealjs.spec.tswith the fixturetests/docs/playwright/revealjs/chalkboard-buttons.qmd:I don't have a dev build of Quarto on this Windows machine, so I couldn't render the fixture with
quarto render. To check the tests, I put together a Reveal.js deck from the repo's ownreveal.js, chalkboard plugin,support.js,footer.cssandquarto-menu.css, with the same slides as the fixture. I served it fromtests/docs/playwright/revealjs/and ran the new tests against it in Chromium:support.jsandfooter.cssfrommain: all 3 failed, as expected.In the same deck, the icon positions and sizes match
mainexactly at 1280px and 700px widths, and clicking the buttons with the mouse still works.Checklist
I have (if applicable):
AI-assisted PR