angular / angular/components

matTabLink `disabled` input should be `matTabLinkDisabled`

Đang mở
#17,446 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
area: material/tabs G P3 target: major
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ả

#### Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-zju32k

Steps to reproduce:
1. Put a tooltip on a `matTabLink`
2. Disabled the `matTabLink`

#### Expected Behavior

Tab should be disabled, and tooltip should show.

#### Actual Behavior

Tooltip did not show.

#### Notes/Thoughts

If the input is changed to `matTabLinkDisabled`, then `disabled` and `[disabled]="true"` should still be able to work. However, it would also be possible to use `matTabLinkDisabled`, which would make it possible to disable the `MatTabLink` specifically, without disabling any other directive on the element.

I *believe* this would be a non breaking change, as the input is declared in the `inputs` field on component:

```typescript
@Directive({
selector: '[mat-tab-link], [matTabLink]',
exportAs: 'matTabLink',
inputs: ['disabled', 'disableRipple', 'tabIndex'], // <== HERE
host: {
'class': 'mat-tab-link',
'[attr.aria-current]': 'active ? "page" : null',
'[attr.aria-disabled]': 'disabled',
'[attr.tabIndex]': 'tabIndex',
'[class.mat-tab-disabled]': 'disabled',
'[class.mat-tab-label-active]': 'active',
}
})
export class MatTabLink
```
So *my understanding* is right now, you can’t read the disabled field by name anyways.

#### Environment

- Angular: 8.2.11
- CDK/Material: 8.2.1
- Browser(s): Version 77.0.3865.120 (Official Build) (64-bit)
- Operating System (e.g. Windows, macOS, Ubuntu): Debian Rodette

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 và khai báo directive MatTabLink được hiển thị trong issue, tập trung vào tương tác giữa input disabled của nó và tooltip. Hoàn thành nghĩa là một liên kết tab bị vô hiệu hóa vẫn hiển thị tooltip của nó, trong khi cả disabled và matTabLinkDisabled vẫn có thể sử dụng được như mô tả.

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