angular / angular/components

bug(MAT-ERROR): mat error content with block element gives extra space of 16px

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

### Description

If the error message is rendered within a block element (we have some error message which are from a database and have a div element), an extra space is added. If this done by design, maybe it should also be mentioned in the docs?
Look at this example: https://stackblitz.com/edit/g5mias?file=src%2Fexample%2Fform-field-error-example.html

### Reproduction

StackBlitz link: https://stackblitz.com/edit/g5mias?file=src%2Fexample%2Fform-field-error-example.html
Steps to reproduce:
1. focus and blur the field

### Expected Behavior

Render the error messages directly underneath the input field

### Actual Behavior

The error messages are shown 16px below the input field

### Environment

- Angular: 16 latest
- CDK/Material: 16 latest

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

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

調査の方向性

src/example/form-field-error-example.html にあるリンク先の StackBlitz の例から始め、フィールドにフォーカスしてからフォーカスを外して問題を再現します。Angular 16 Material のエラー表示と期待される配置を比較します。ブロック要素のエラーコンテンツが、余分な 16px の間隔なしに入力フィールドの直下に表示されれば完了です。

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

評価

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

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

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