Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

a11y: shortlist drops focus to body on Clear and last Remove, and adding an item gives no in-view feedback

已關閉
#156 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
1-2 天
新手友好度
57/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
javascript

研究方向

Start with site/public/shortlist.js, especially lines 117 and 124, and inspect renderPanel() plus the existing polite live region and sticky controls. Reproduce Clear and last Remove to check focus, then add an item from a lower visible card to observe feedback and layout movement. Done means focus stays off body, additions announce and show the count in view, and adding causes no layout shift without scroll anchoring.

由索引模型根據 Issue 內容生成。

描述

accessibility priority: medium

Why it matters

Keyboard and screen-reader users lose their place twice (focus lands on <body>), and every user who stars a card deep in the list gets no visible confirmation beyond the button label change, because the panel appears above the grid, often screens away. In browsers without scroll anchoring (WebKit) the list also jumps under the thumb.

Evidence (at 69387df, local build)

  • Click "Clear shortlist" -> document.activeElement === document.body. Add one, click "Remove" -> body. site/public/shortlist.js:117 focuses #shortlist, which renderPanel() has just set hidden; line 124 update([]) hides the panel containing the focused button.
  • Adding from the 4th visible card at 375 px: the panel is inserted about 360 px above the card with a height of 310 px; Chrome's scroll anchoring compensated, Safari has none. The only feedback is the button text "On shortlist".

Suggested approach

When the panel hides, focus #search or #result-count; announce "Added to shortlist (N)" / "Removed ..." through the existing polite live region; show a persistent "Shortlist (N)" control in the sticky controls (or on the floating to-top button) that scrolls to and focuses the panel. Rendering the panel as a one-line sticky summary under the controls would also remove the layout jump.

Done when

Focus never lands on <body> after a shortlist action; adding announces and shows a count in view; no layout shift in browsers without scroll anchoring.

主要語言
JavaScript
星號
58
分支
15
平均合併
16 小時 53 分鐘
30 天內合併 PR
14

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TMHSDigital/Free-Game-Dev-Assets 的其他 Issue

查看 TMHSDigital/Free-Game-Dev-Assets 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。