bug(form-field): notch width is out of sync with custom label content during layout changes
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- angular, typescript
- 領域
- frontend
調査の方向性
src/main.ts にある提供済みの StackBlitz 再現コードから始め、コンテナのサイズ変更時の mat-form-field のアウトラインの挙動を調べます。レイアウトの変更中に、フローティング mat-label の内容とノッチを比較します。ノッチがラベルの幅に同期して追従し、目に見えるスライド、ずれ、重なりがなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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 MDC-based mat-form-field (outline appearance) fails to synchronously update the notch (gap) width when the content inside mat-label changes its layout or when the container is resized. This is especially evident when using custom components with Flexbox inside the label (e.g., for adding help icons or tooltips).
Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-starter-gnupffhv?file=src%2Fmain.ts
Steps to reproduce:
- Create a
mat-form-fieldwithappearance="outline"andfloatLabel="always". - Apply
display: flexto themat-label(or a container immediately inside it). - Place a text string and an icon (e.g.,
mat-icon) inside that flex container. - Dynamically change the width of the form field's container (e.g., by resizing the browser window or using a slider in the provided reproduction).
- Observe the behavior of the label content and the notch gap.
Expected Behavior
The notch gap should resize synchronously with the label content to prevent any "sliding" or "drifting" effect. The gap in the outline should always match the actual width of the floating label in real-time during container resizing or layout shifts, ensuring that the border never overlaps the label's text or icons.
Actual Behavior
There is a significant visual lag in the label's positioning and scaling. While the browser's layout engine expands the container instantly, the label's text content moves and resizes with a delay.
In this implementation, we intentionally prioritize the visibility of the tooltip/icon over the label text.. This ensures that the help trigger is always accessible to the user, even on small screens
Lag Animation: https://github.com/user-attachments/assets/a3e9ff59-8586-449b-95d1-d5d0b3e0f727
Environment
- Angular: 21.2.10
- CDK/Material: 21.2.8
- Browser(s): Chrome 147.0.7727.138
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 92
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angular/components のほかの issue
-
area: material/datepicker P4
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/components#33763 · コメント 2 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
area: material/table P4
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
angular/components#33709 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: material/table docs gemini-triaged P4
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/components#33455 ·
メンテナーはふだん 1 日以内に返信
-
area: material/core gemini-triaged P3
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
angular/components#33059 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area: material/dialog P2
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
angular/components#30536 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
angular/components の issue をすべて見る
似ている issue
-
ADD openalgoオープンtemplate
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
bug Needs: Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoft/fluentui-contrib#671 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
sveltejs/acorn-typescript#150 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100