angular / angular/components

bug(MatSelect): Mdc line ripple doesn't use the color from the theme if it gets disabled right after receiving a value

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

The bottom "line ripple" of a mat-select field doesn't always retrieve its color from the theme variable `--mdc-filled-text-field-disabled-active-indicator-color` when disabled.

See example below :
Screenshot 2024-04-10 at 10 46 25

On this example, the two select inputs are identical and inherit the same styles, the sole difference is that the first input is disabled from the start and the second input is disabled once an option is selected.

If I inspect the line ripple, it seems that once I picked a value and disabled the input the line ripple `:after` selector changes and inherit a color from `--mat-app-text-color` :
Screenshot 2024-04-10 at 10 40 58

If I manually change the color in `:after` to transparent, I get the expect result :
Screenshot 2024-04-10 at 10 41 15

### Reproduction

StackBlitz link: https://stackblitz.com/edit/jnudjj
Steps to reproduce:
1. In theme.scss, after Material theme import, override the value from ` --mdc-filled-text-field-disabled-active-indicator-color`to differentiate it easily
2. Create a component with one mat-select input which gets disabled right after we picked a value :
``

### Expected Behavior

I get an indentical color for the line ripple whether mat-select is disabled from the start or after picking a value.

### Actual Behavior

When a mat-select input gets disabled right after a value is picked, the line ripple color is not correct.

### Environment

- Angular: 17.3.1
- CDK/Material: 17.3.1
- 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 trên StackBlitz, phần override của theme.scss và component mat-select có trạng thái bị vô hiệu hóa phụ thuộc vào một giá trị được chọn. So sánh kiểu dáng line ripple khi select bắt đầu ở trạng thái bị vô hiệu hóa với kiểu dáng sau khi lựa chọn khiến nó bị vô hiệu hóa. Hoàn tất khi cả hai trường hợp đều sử dụng --mdc-filled-text-field-disabled-active-indicator-color đã được override.

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, scss, 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
45/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.