Skip to content

Make Reveal.js chalkboard buttons keyboard accessible - #15436

Merged
cderv merged 1 commit into
quarto-dev:mainfrom
seragAhmed:bugfix/15428-chalkboard-buttons-keyboard
Nov 30, 2026
Merged

cderv merged 1 commit into
quarto-dev:mainfrom
seragAhmed:bugfix/15428-chalkboard-buttons-keyboard

Conversation

@seragAhmed

Copy link
Copy Markdown
Contributor

Description

Fixes #15428.

With chalkboard: true, addChalkboardButtons in plugins/support/support.js built "Toggle Chalkboard (b)" and "Toggle Notes Canvas (c)" as <span> elements with an onclick handler. 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:

  • builds each control as a <button type="button"> with an aria-label ("Toggle Chalkboard", "Toggle Notes Canvas"), aria-keyshortcuts (b, c), the same title tooltip as before, and a stable class (chalkboard-toggle-chalkboard, chalkboard-toggle-notes-canvas);
  • marks the Font Awesome icon aria-hidden="true";
  • stops Enter and Space keydown events on the buttons from reaching reveal.js's document key handler, so Space activates the button instead of moving to the next slide;
  • resets the native button styling in 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.ts with the fixture tests/docs/playwright/revealjs/chalkboard-buttons.qmd:

  • both controls are exposed as buttons with the accessible names "Toggle Chalkboard" and "Toggle Notes Canvas";
  • Tab reaches the chalkboard button, Enter opens the chalkboard and Enter again closes it, and the slide does not change;
  • Space on the notes canvas button turns the notes canvas on and the slide does not change.

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 own reveal.js, chalkboard plugin, support.js, footer.css and quarto-menu.css, with the same slides as the fixture. I served it from tests/docs/playwright/revealjs/ and ran the new tests against it in Chromium:

  • with this change: 9/9 passed (3 repeats);
  • with support.js and footer.css from main: all 3 failed, as expected.

In the same deck, the icon positions and sizes match main exactly at 1280px and 700px widths, and clicking the buttons with the mouse still works.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

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
@posit-snyk-bot

posit-snyk-bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv cderv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. This is good change !

@cderv
cderv merged commit 471535e into quarto-dev:main Nov 30, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reveal.js chalkboard buttons cannot be reached with the keyboard

3 participants