angular / angular/components

bug(mat-label): trailing white-space between text and asterisk

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

描述

### Is this a regression?

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

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

14

### Description

It's all in the title.

image

Might be related to https://github.com/angular/components/issues/27722.

### Reproduction

https://stackblitz.com/edit/vcau9e

### Expected Behavior

White-space should be trimmed (e. g. by making mat-label `display: inline-block`).

### Actual Behavior

I see UI being dependent on html formatting.

### Environment

```
Angular CLI: 16.2.9
Node: 18.12.0
Package Manager: yarn 1.22.19
OS: win32 x64

Angular: 16.2.12
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1602.9
@angular-devkit/build-angular 16.2.9
@angular-devkit/core 16.2.9
@angular-devkit/schematics 16.2.9
@angular/cdk 16.2.11
@angular/cli 16.2.9
@angular/fire 7.6.1
@angular/material 16.2.11
@angular/material-moment-adapter 16.2.11
@schematics/angular 16.2.9
rxjs 7.8.1
typescript 5.1.6
webpack 5.89.0
zone.js 0.13.3
```

Also reproducible in version 15.

贡献指南

打开贡献指南

调研方向

从链接的 StackBlitz 复现开始,比较 Angular Material 14–16 版本中报告的 mat-label 渲染结果。跟踪 mat-label 组件及其样式,以确定 HTML 格式为何会影响星号前的间距。完成的标准是:等效的 label 标记渲染时没有尾随空白,并且回归测试覆盖该行为。

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

评估

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

把新 issue 发到你的邮箱

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