angular / angular/components

bug(form-field): matTextSuffix/matTextPrefix not vertically aligned with label

未关闭
#28,448 2 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
area: material/form-field P3
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

### 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 label of a mat-form-field is not vertically aligned with the matTextSuffix or matTextPrefix.

![Screenshot 2024-01-18 at 8 42 10 AM](https://github.com/angular/components/assets/32067562/47159140-76bf-4b6c-ab2f-2e76f2fced4a)

Notice how the suffix and prefix are a couple or so pixels above the label

### Reproduction

StackBlitz link: https://stackblitz.com/edit/t9161j?file=src%2Fexample%2Fform-field-prefix-suffix-example.html

### Expected Behavior

Label to be vertically aligned with both matTextSuffix and matTextPrefix

### Actual Behavior

Label is not vertically aligned with both matTextSuffix and matTextPrefix

### Environment

- Angular: 16
- CDK/Material: ^16.2.7
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

贡献指南

打开贡献指南

调研方向

从 src/example/form-field-prefix-suffix-example.html 中链接的 StackBlitz reproduction 开始,确认 Angular 16 中 label 与 matTextSuffix/matTextPrefix 之间的垂直偏移。根据该示例追踪 Material form-field 的渲染和样式,然后验证 reproduction 中的 label、prefix 和 suffix 在垂直方向上对齐。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
design, frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。