angular / angular/components

bug(select[matNativeControl]): Sometimes the options are not triggered

Đang mở
#27,682 2 bình luận 1 reaction 0 người được giao Xem trên GitHub
area: material/select P2
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?

- [X] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

prior to mdc migration

### Description

when using `select[matNativeControl]` inside `` there's a couple of problems:

1. when using an empty string as the default option, the label appears within the form field. directly clicking the label does not trigger the options.
2. clicking just inside `mat-form-field` (inside the outline) also does not trigger the options

### Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-r49x2i?file=src%2Fapp%2Fexample-component.html
Steps to reproduce:
1. click the label while it's within the form field
2. also click just inside the bounds of the form field

### Expected Behavior

triggers the options

### Actual Behavior

options are not triggered - label just moves up

### Environment

- Angular: 16.1.2
- CDK/Material: 16.1.3
- Browser(s): chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện StackBlitz được liên kết và sự tương tác giữa select[matNativeControl] với mat-form-field appearance="outline". Tái hiện các lần nhấp vào nhãn và đường viền, sau đó xác minh rằng cả hai đều kích hoạt các tùy chọn mà vẫn giữ nguyên hành vi mong đợi của nhãn.

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

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.