Angular ARIA autocomplete selecting options with mouse click or enter don't select them, only with pressing tab.
維護者通常 1 天內回覆
@ok7sai 已經在處理了。
開始於 2026年4月1日。
評估
這個 Issue 還沒有評估資料。
描述
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
When I setup the Autocomplete component with Angular ARIA components, like in the example provided on the angular website. There is something weird going on with selecting the searched options with a mouse click or pressing Enter.
Reproducing the "bug"
When I use the filterMode auto-select and I search for n, a sub-set of the country list will appear. If I now move to the second or third option in the list and press enter the value in the input field will be filled with the slected option. But when I check the selected option with an effect, it is the first option of the filtered list.
When you do the same filtering and navigate to the second/thrid option and instead press tab. The selected options is actually selected.
I have made a stackblitz example to show this: https://stackblitz.com/edit/stackblitz-starters-xnilgqyl?file=src%2Fmain.ts,src%2Fcomponents%2Fautocomplete.ts
Is this behaviour by design? That the selection only works on the tab-keypress?
Work around
The workaround we are using right now is to also bind query to the [(value)] of the ngComboboxInput, this way we always get the right selection. The drawback is that we get a console error out of ngCombobox.
my-component.container.html:11 ERROR TypeError: Cannot read properties of undefined (reading 'length')
at ComboboxPattern.onFilter (_combobox-chunk.mjs:221:55)
at combobox.mjs:308:46
at untracked (_effect-chunk.mjs:403:12)
at untracked2 (_untracked-chunk.mjs:2957:10)
at combobox.mjs:308:7
at Object.phaseFn (core.mjs:2693:30)
at AfterRenderEffectSequence.hooks.<computed> (core.mjs:2729:41)
at _debug_node-chunk.mjs:4155:27
at _AfterRenderImpl.maybeTrace (_debug_node-chunk.mjs:4212:75)
at _debug_node-chunk.mjs:4153:78
Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run ng version)
Anything else?
No response
- 主要語言
- TypeScript
- 星號
- 25k
- 分支
- 6.8k
- 平均合併
- 1 天 5 小時
- 30 天內合併 PR
- 67
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
angular/components 的其他 Issue
-
bug(material/sort): hover hint arrow on an unsorted header shows the active sort direction, not the resulting direction after click.可能已有人在做 @lekhmanrus 於 11 天前認領。 未關閉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 於 28 天前認領。 未關閉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 於 15 天前認領。 未關閉area: material/table P4
難度 1/5 1 小時以內 新手友好度 88/100
angular/components#33709 · 1 則留言 ·
維護者通常 1 天內回覆
-
docs-bug(Table): Add example with `rowspan`可能已有人在做 @BHUVANSH855 於 95 天前認領。 未關閉area: material/table docs P4
難度 2/5 1-3 小時 新手友好度 72/100
angular/components#33455 ·
維護者通常 1 天內回覆
-
bug(date-adapter): Misleading JSDoc for createDate returns type可能已有人在做 @BHUVANSH855 於 145 天前認領。 未關閉area: material/core P3
難度 1/5 1 小時以內 新手友好度 78/100
angular/components#33059 · 2 則留言 ·
維護者通常 1 天內回覆
查看 angular/components 的全部 Issue
相似的 Issue
-
"Contains" page watch never matches when its text has a trailing space可能已有人在做 @RaphaelFakhri 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 77/100
CopilotKit/openmuse#184 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 67/100
bootstrap-vue-next/bootstrap-vue-next#3357 ·
維護者通常 1 天內回覆
-
[quality] tide.ts: six mutation survivors in the merge-queue gate, draft refusal, fork-403 workflow-file diagnosis and getPull's fork flag are unpinned by any test可能已有人在做 @hivecommons-hive 今天認領。 未關閉agent/quality needs-kind stage/040-covered-by-pr testing
難度 2/5 1-3 小時 新手友好度 68/100
cncf/prow-github-actions#517 · 1 則留言 ·
維護者通常 2 天內回覆
-
Unsampled pageload span is profiled when profileLifecycle is 'trace' (browser UI profiling)可能已有人在做 @Jxxunnn 今天認領。 未關閉Browser Waiting for: Product Owner
難度 2/5 1-3 小時 新手友好度 82/100
getsentry/sentry-javascript#25497 · 1 則留言 ·
維護者通常 1 天內回覆