Focus falls to the body when a keyboard user dismisses the announcement bar
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- accessibility, frontend
Research direction
Start with the click handler in src/resources/projects/website/navigation/quarto-nav.js, linked in the issue, and inspect how the announcement bar is removed and where focus can move next. Reproduce the reported case by focusing and clicking button.quarto-announcement-action, then check document.activeElement. Done when dismissing the bar leaves focus on the next focusable element, or on main with tabindex="-1" if none exists.
Written by the indexing model from the issue text.
Description
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
When a keyboard user presses the dismiss button of the announcement bar, Quarto removes the bar, and the focused button goes with it.
Focus falls back to <body>, so the next Tab starts again from the top of the page.
A screen reader user loses their place too.
This fails WCAG 2.4.3 Focus Order (Level A).
#15253 made the control a button that works with the keyboard (#15235).
The click handler only hides the bar:
When the bar had focus, the handler should move focus to the next focusable element after the bar, or to <main> (with tabindex="-1") when there is none.
Steps to reproduce
_quarto.yml:
project:
type: website
website:
title: Announcement
navbar:
left:
- href: index.qmd
text: Home
announcement:
content: This is an announcement.
dismissable: true
format: html
index.qmd:
---
title: Home
---
Home page.
Render the website, open index.html, Tab to the dismiss button, and press Enter.
The same check in a script:
document.querySelector("button.quarto-announcement-action").focus();
document.querySelector("button.quarto-announcement-action").click();
document.activeElement.tagName;
Actual behavior
The bar is removed and document.activeElement is BODY.
Expected behavior
The bar is removed and focus is on a control that is still on the page, such as the next link in the navbar.
Your environment
- Quarto: 99.9.9 (development build, commit 83432c0).
- Browser: Chromium (Playwright).
- OS: macOS 27.2.1.
Quarto check output
Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.13.0: OK
Dart Sass version 1.107.1: OK
Deno version 2.9.8: OK
Typst version 0.15.1: OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: 83432c028f6c07167c23f948da7067b37fe8a18b
- Dominant language
- JavaScript
- Stars
- 6.2k
- Forks
- 496
- Avg merge
- 15h 47m
- Merged PRs (30d)
- 87
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quarto-dev/quarto-cli
-
accessibility bug dark-mode dashboards
Difficulty 1/5 Under an hour Newbie friendliness 84/100
quarto-dev/quarto-cli#15447 ·
Maintainers usually reply within 1 day
-
accessibility bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
quarto-dev/quarto-cli#15442 ·
Maintainers usually reply within 1 day
-
accessibility bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
quarto-dev/quarto-cli#15440 ·
Maintainers usually reply within 1 day
-
accessibility bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
quarto-dev/quarto-cli#15438 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#15431 · 3 comments ·
Maintainers usually reply within 1 day
All issues in quarto-dev/quarto-cli
Similar issues
-
01 type: bug 41 lvl: easy
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
521xueweihan/HelloGitHub#4655 ·
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount duePossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
bug CRIT-3
Difficulty 1/5 Under an hour Newbie friendliness 70/100
NASA-AMMOS/anms#426 ·