angular / angular/components

bug(form-field): mat-label disappears when density < -1

オープン
#26,579 コメント 19 件 リアクション 73 件 担当者 0 名 GitHub で見る
area: material/form-field P2
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
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

Hi,
There seems to be an issue where the mat-labels disappear when the density of form-field is set to lower than -1. I don't think this is as designed...

### Reproduction

Steps to reproduce:
1. Set the density option to anything lower than -1, ex: `@include mat.form-field-density(-2);`
2. Include a mat-form-field with the appearance set to "fill", with a mat-label

notice the labels do not appear. (Their css is set as "display:none;")

Demo: https://stackblitz.com/edit/angular-wvlwej
In the stackblitz, you can see that the labels appear fine when density is set at >= -1, but anything lower and the label is hidden.

![image](https://user-images.githubusercontent.com/8459019/217098883-527e1c7c-71a2-4cb2-8c3e-2dc2c6a1b964.png)

### Expected Behavior

The labels should be visible

### Actual Behavior

The labels are not visible

### Environment

- Angular: 15.1.3
- CDK/Material: 15.1.3
- Browser(s): Chrome Version 109.0.5414.120
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンクされた StackBlitz の再現手順と、fill mat-form-field に対する mat.form-field-density(-2) 設定から始めます。-1 未満の密度における mat-label の生成済み CSS を調査します。完了条件は、ラベルが表示されたままであり、-1 以上の密度と同じ動作になり、再現したケースのリグレッションカバレッジがあることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, sass
領域
design, frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
58/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。