bug(Autocomplete): matAutocomplete with control initial value does not highlight value in options with check icon
- Ngôn ngữ chính
- TypeScript
- Star
- 25k
- Fork
- 6.8k
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 91
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
A MatAutocomplete field initialized with a control value does not highlight item in options
### Reproduction
StackBlitz link: https://stackblitz.com/edit/saqfud?file=src%2Fexample%2Fautocomplete-filter-example.ts,src%2Fexample%2Fautocomplete-filter-example.html,src%2Fexample%2Fautocomplete-filter-example.css
Steps to reproduce:
1. Set initial value of control (second one value for example)
```
options: string[] = ['One', 'Two', 'Three'];
myControl = new FormControl(this.options[1]);
```
3. click on input on UI
### Expected Behavior
Second one option is highlighted

### Actual Behavior
second option is not highlighted

### Environment
- Angular:
- CDK/Material:
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách chạy bản tái hiện StackBlitz được liên kết và kiểm tra src/example/autocomplete-filter-example.ts cùng src/example/autocomplete-filter-example.html. Xác nhận rằng có một giá trị được chọn ban đầu, nhưng tùy chọn tương ứng không được tô sáng khi mở ô nhập. Được xem là hoàn tất khi tùy chọn thứ hai được tô sáng nhất quán đối với giá trị FormControl ban đầu được cung cấp, kèm theo một bài kiểm thử hồi quy bao quát hành vi này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, typescript
- Lĩnh vực
- frontend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100