bug(aria/combobox): `filterMode="auto-select"` returns old value
Maintainer thường phản hồi trong vòng 1 ngày
@ok7sai đang làm issue này rồi.
Từ ngày 1/4/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
angular/aria combobox with multi false, readonly false and filterMode="auto-select" returns old selected value.
If now we have AAA as selected but then we select BBB and hit Enter key -> we mustn't see AAA. Because we select another (BBB) value and approve it by Enter.
values():
<div>{{ listbox()?.values() | json }}</div>
<div ngCombobox [filterMode]="filterMode()" [readonly]="false">
<div #origin class="autocomplete">
<span
class="search-icon material-symbols-outlined"
translate="no"
aria-hidden="true"
>search</span
>
<input
aria-label="Label dropdown"
placeholder="Select a country"
[(ngModel)]="query"
ngComboboxInput
/>
</div>
<ng-template ngComboboxPopupContainer>
<ng-template
[cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}"
[cdkConnectedOverlayOpen]="true"
>
<div class="popup">
@if (countries().length === 0) {
<div class="no-results">No results found</div>
}
<div ngListbox [multi]="false">
@for (country of countries(); track country) {
<div ngOption [value]="country" [label]="country">
<span class="option-label">{{ country }}</span>
<span
class="check-icon material-symbols-outlined"
translate="no"
aria-hidden="true"
>check</span
>
</div>
}
</div>
</div>
</ng-template>
</ng-template>
</div>
import {
Combobox,
ComboboxInput,
ComboboxPopupContainer,
} from '@angular/aria/combobox';
import { Listbox, Option } from '@angular/aria/listbox';
import { OverlayModule } from '@angular/cdk/overlay';
import { CommonModule } from '@angular/common';
import {
ChangeDetectionStrategy,
Component,
computed,
input,
signal,
viewChild,
viewChildren,
} from '@angular/core';
import { FormsModule } from '@angular/forms';
const ALL_COUNTRIES = ['AAA', 'BBB', 'CCC', 'DDD'];
@Component({
selector: 'CustomCombobox',
templateUrl: 'combobox.html',
styleUrl: './combobox.scss',
imports: [
CommonModule,
Combobox,
ComboboxInput,
ComboboxPopupContainer,
Listbox,
Option,
OverlayModule,
FormsModule,
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CustomCombobox {
public filterMode = input.required<'manual' | 'auto-select' | 'highlight'>();
/** The combobox listbox popup. */
listbox = viewChild<Listbox<string>>(Listbox);
/** The options available in the listbox. */
options = viewChildren<Option<string>>(Option);
/** A reference to the ng aria combobox. */
combobox = viewChild<Combobox<string>>(Combobox);
/** The query string used to filter the list of countries. */
query = signal('');
/** The list of countries filtered by the query. */
countries = computed(() =>
ALL_COUNTRIES.filter((country) =>
country.toLowerCase().startsWith(this.query().toLowerCase())
)
);
constructor() {
}
}
Reproduction
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-gopytywj?file=src%2Fmain.ts,src%2Fcombobox%2Fcombobox.html
Steps to reproduce:
- type aaa -> values() are ["AAA"]
- remove input value
- Now: empty input and values(). Use arrow up/down keys to select BBB, CCC or DDD. Not AAA
- hit Enter key
- But values() are ["AAA"] again
Expected Behavior
We select BBB and hit Enter key -> we must see BBB, not AAA.
Actual Behavior
We select BBB, CCC, DDD and hit Enter key -> we see previous value: AAA
Environment
- Angular: 21.0.3 and later
- angular/aria: 21.0.2 - 21.2.0-next.0
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):
- Ngôn ngữ chính
- TypeScript
- Star
- 25k
- Fork
- 6.8k
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 67
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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 angular/components
-
bug(aria/combobox): keys pressed back to back are lost; only the last one reaches the popupCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea: aria/combobox gemini-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
angular/components#33973 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(aria/combobox): ComboboxPopup throws NG0950 when destroyed before its first change detectionCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea: aria/combobox gemini-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
angular/components#33972 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(material/sort): hover hint arrow on an unsorted header shows the active sort direction, not the resulting direction after click.Có thể đã có người làm @lekhmanrus đã nhận 12 ngày trước. Đang mởarea: material/sort P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
angular/components#33933 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(mat-date-picker): month shown twice in date pickerCó thể đã có người làm @PreethiPantangi đã nhận 29 ngày trước. Đang mởarea: material/datepicker P4
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
angular/components#33763 · 2 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug in table.scss footer cell height: unset instead of footer row height unsetCó thể đã có người làm @minwookshin đã nhận 16 ngày trước. Đang mởarea: material/table P4
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
angular/components#33709 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của angular/components
Issue tương tự
-
engine-rs P3 review-deferral wasm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
maniator/verticopolis#1154 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
telerik/kendo-react#3861 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[bug]: use-mobile.ts uses pixel logic, causing UI state de-sync with Tailwind CSS rem breakpointsĐang mởbug
Độ 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
-
task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100