angular / angular/components

bug(TABS): tabs with fitInkBarToContent does not follow Material 3 design specs

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

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

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

_No response_

### Description

As per [Material 3 guidelines](https://m3.material.io/components/tabs/specs), primary tabs should have active indicator's height of `3px` and shape of `3px 3px 0 0`. In Angular Material, primary tabs' behaviour can be achieved using `[fitInkBarToContent]=true` input.

But, they have height of `2px`, and shape of `0`, which is right only for secondary tabs.

We can override it by using `tabs-overrides` mixin like below:

```scss
@use '@angular/material' as mat;

[fitInkBarToContent],
[ng-reflect-fit-ink-bar-to-content='true'] {
> .mat-mdc-tab-header {
@include mat.tabs-overrides(
(
active-indicator-shape: 3px 3px 0 0,
active-indicator-height: 3px,
)
);
}
}
```

But, it should be the default behaviour as per Material 3 specs.

### Reproduction

Not needed.

### Expected Behavior

Tabs with `[fitInkBarToContent]=true` should have active indicator's height of `3px` and shape of `3px 3px 0 0`.

### Actual Behavior

Tabs with `[fitInkBarToContent]=true` have active indicator's height of `2px`, and shape of `0`.

### Environment

- Angular: 19
- CDK/Material: 19
- Browser(s): Edge
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

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

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

Hướng nghiên cứu

Bắt đầu từ phần triển khai tabs của Angular Material và mixin tabs-overrides, lần theo đường dẫn fitInkBarToContent và các kiểu active-indicator trên .mat-mdc-tab-header. Hoàn thành khi input này tạo ra một active indicator 3px với hình dạng 3px 3px 0 0, khớp với kỳ vọng Material 3 đã nêu.

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
42/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.