Focus falls to the body when a keyboard user dismisses the announcement bar
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- accessibility, frontend
Hướng nghiên cứu
Bắt đầu với trình xử lý sự kiện nhấp trong src/resources/projects/website/navigation/quarto-nav.js, được liên kết trong issue, rồi kiểm tra cách thanh thông báo được gỡ bỏ và tiếp theo tiêu điểm có thể chuyển đến đâu. Tái hiện trường hợp được báo cáo bằng cách đặt tiêu điểm vào button.quarto-announcement-action và nhấp vào đó, sau đó kiểm tra document.activeElement. Hoàn tất khi đóng thanh khiến tiêu điểm vẫn ở phần tử tiếp theo có thể nhận tiêu điểm, hoặc ở main với tabindex="-1" nếu không có phần tử nào như vậy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- JavaScript
- Star
- 6.2k
- Fork
- 492
- Merge trung bình
- 13 giờ 51 phút
- Pull request đã merge (30 ngày)
- 82
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quarto-dev/quarto-cli
-
accessibility bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/quarto-cli#15440 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
quarto-dev/quarto-cli#15438 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
quarto-dev/quarto-cli#15431 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bootstrap enhancement themes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
quarto-dev/quarto-cli#15421 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
quarto-dev/quarto-cli#15408 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/quarto-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
crxjs/chrome-extension-tools#1261 ·
-
support
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
01 type: bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
conorbronsdon/avoid-ai-writing#559 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
agentregistry-dev/website#69 ·