bug(form-field): remove hint wrapper when no hint provided
- 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
Even when no hint is provided, the hint-wrapper dom element still shows up.
This is because `mat-form-field-subscript-wrapper` has a margin as specified here:
```CSS
.mat-form-field-subscript-wrapper {
font-size: $subscript-font-size;
margin-top: $subscript-margin-top;
```

### Reproduction
Steps to reproduce:
1. Add an outline material form field without any hint and inspect.
eg:
```HTML
Outline form field
```
### Expected Behavior
When no hint is being provided, the wrapper dom element shouldn't render.
### Actual Behavior
The wrapper renders and takes up space.
### Environment
- Angular: 13.3.5
- CDK/Material: 13.3.5
- Browser(s): Chrome / all
- Operating System (e.g. Windows, macOS, Ubuntu): macOS/ all
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ outline mat-form-field được cung cấp và kiểm tra DOM được tạo ra, đặc biệt là phần tử mat-form-field-subscript-wrapper và khoảng cách của nó. Issue được hoàn thành khi một trường biểu mẫu không có hint không render wrapper đó và không còn khoảng trống không mong muố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
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 68/100