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

Angular ARIA autocomplete selecting options with mouse click or enter don't select them, only with pressing tab.

未關閉
#32,765 1 則留言 0 個 reaction 已指派 1 人 在 GitHub 檢視

維護者通常 1 天內回覆

@ok7sai 已經在處理了。

開始於 2026年4月1日。

評估

這個 Issue 還沒有評估資料。

描述

area: aria/combobox P3
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

https://stackblitz.com/edit/stackblitz-starters-xnilgqyl?file=src%2Fmain.ts,src%2Fcomponents%2Fautocomplete.ts

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 範本
  • 閱讀貢獻指南

從這裡開始

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

angular/components 的其他 Issue

查看 angular/components 的全部 Issue

相似的 Issue

更多 TypeScript Issue

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

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