bug(aria/accordion): Enter/Space inside a panel toggles the accordion instead of activating the focused element
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 72/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- angular, typescript
研究方向
從 issue 中指出的 src/aria/private/accordion/accordion.ts 裡的 keydown 處理器開始,並將其事件目標與 click 處理器的事件目標進行比較。使用連結的 StackBlitz 重現此行為,特別檢查面板控制項上的 Enter 和 Space,以及輸入欄位中的 Home。當這些按鍵在面板內容中正常運作,同時手風琴的鍵盤控制項在觸發器上仍正常運作時,即告完成。
由索引模型根據 Issue 內容生成。
描述
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Pressing Enter on a link (or Space on a button) inside an expanded ngAccordionPanel collapses the panel instead of activating the link/button.
ngAccordionGroup handles keydown for the whole group, including panel content, and calls preventDefault() on Enter/Space, so the focused element never gets activated. Arrow keys and Home/End are affected too, e.g. Home in an input inside a panel moves focus to the trigger.
The click handler only reacts to events coming from a trigger (_findTriggerPattern), the keydown handler doesn't check that:
https://github.com/angular/components/blob/952685f9370ba718f832d745512db7c9a04e1bcd/src/aria/private/accordion/accordion.ts#L73-L97
Reproduction
StackBlitz link: https://stackblitz.com/edit/z5sxyaq6?file=src%2Fmain.ts
Steps to reproduce:
- Expand "Section 1".
- Tab to "Link inside panel" or "Button inside panel" and press Enter / Space.
- Expand it again, click into the input and press Home.
Expected Behavior
The link/button is activated (shows up in the log) and the panel stays open. Home moves the caret in the input.
Actual Behavior
The panel collapses, nothing is activated. Home moves focus to the trigger.
Environment
- Angular: 22.2.3
- CDK/Material: @angular/aria 22.2.4 (also 22.1.6)
- Browser(s): Chrome 155
- Operating System (e.g. Windows, macOS, Ubuntu): Linux
- 主要語言
- TypeScript
- 星號
- 25k
- 分支
- 6.8k
- 平均合併
- 3 天 7 小時
- 30 天內合併 PR
- 59
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
angular/components 的其他 Issue
-
bug(aria/combobox): keys pressed back to back are lost; only the last one reaches the popup可能已有人在做 @drakeo338 於 7 天前認領。 未關閉area: aria/combobox gemini-triaged
難度 2/5 1-3 小時 新手友好度 78/100
angular/components#33973 ·
維護者通常 1 天內回覆
-
bug(material/sort): hover hint arrow on an unsorted header shows the active sort direction, not the resulting direction after click.可能已有人在做 @lekhmanrus 於 19 天前認領。 未關閉area: material/sort P3
難度 2/5 1-3 小時 新手友好度 70/100
angular/components#33933 ·
維護者通常 1 天內回覆
-
bug(mat-date-picker): month shown twice in date picker可能已有人在做 @PreethiPantangi 於 36 天前認領。 未關閉area: material/datepicker P4
難度 2/5 1-3 小時 新手友好度 72/100
angular/components#33763 · 2 則留言 · 3 個 reaction ·
維護者通常 1 天內回覆
-
Bug in table.scss footer cell height: unset instead of footer row height unset可能已有人在做 @minwookshin 於 23 天前認領。 未關閉area: material/table P4
難度 1/5 1 小時以內 新手友好度 88/100
angular/components#33709 · 1 則留言 ·
維護者通常 1 天內回覆
-
docs-bug(Table): Add example with `rowspan`可能已有人在做 @BHUVANSH855 於 103 天前認領。 未關閉area: material/table docs P4
難度 2/5 1-3 小時 新手友好度 72/100
angular/components#33455 ·
維護者通常 1 天內回覆
查看 angular/components 的全部 Issue
相似的 Issue
-
check:passed streams:add
難度 2/5 1-3 小時 新手友好度 64/100
維護者通常 1 天內回覆
-
area:agents area:cost bug platform:macos
難度 2/5 1-3 小時 新手友好度 77/100
anthropics/claude-code#105375 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 79/100
-
難度 2/5 1-3 小時 新手友好度 79/100
galaxyproject/loom#616 ·
維護者通常 1 天內回覆
-
e2e-failure ready-to-code
難度 2/5 1-3 小時 新手友好度 79/100
redhat-developer/rhdh-plugin-export-overlays#4580 · 1 則留言 ·
維護者通常 1 天內回覆