angular / angular/components

m3 Issue with Dialog Width Property

オープン
#28,604 コメント 2 件 リアクション 3 件 担当者 0 名 GitHub で見る
area: material/dialog P4
主要言語
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

When attempting to set the width property of a dialog element, it does not behave as expected. Specifically, using a fixed width or setting it to 100% results in unexpected behavior. When setting the width to 100%, the dialog is pushed to the left instead of occupying the entire viewport width. This inconsistency in behavior hampers the intended layout and user experience. Further investigation is required to identify the root cause and implement a suitable solution.

### Reproduction

StackBlitz link:
Steps to reproduce:
1. https://ng-comp-devapp.web.app/dialog

### Expected Behavior

1. When setting the width of the dialog element using a fixed value (e.g., pixels), the dialog should render with the specified width without any distortion or unexpected positioning.
2. When setting the width of the dialog element to 100%, it should occupy the entire width of the viewport, ensuring that it is centered horizontally and does not get pushed to the left or right edges of the screen.
3. The dialog should maintain responsiveness, adjusting its width dynamically based on the viewport size while adhering to the specified width constraints.

### Actual Behavior

1. When setting the width of the dialog element using a fixed value, the dialog may render with the specified width, but it might not align properly within the viewport or may not respect the specified width, leading to unexpected layout issues.
2. When setting the width of the dialog element to 100%, it may not occupy the entire width of the viewport as intended. Instead, it might get pushed to the left side of the screen, causing it to appear off-center or misaligned.
3. The responsiveness of the dialog may be compromised, with the width not adjusting appropriately based on the viewport size, leading to inconsistent presentation across different devices or screen sizes.

### Environment

- Angular: 17.2
- CDK/Material: 17.2
- Browser(s): Chrinr
- Operating System (e.g. Windows, macOS, Ubuntu): macos

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

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

調査の方向性

https://ng-comp-devapp.web.app/dialog のダイアログ再現から始め、固定幅と width: 100% がどのように適用されているかを確認します。レンダリングされた配置とレスポンシブ性を、期待される中央揃えの動作と比較します。固定幅のダイアログと全幅のダイアログの両方が、歪みや水平方向のずれなしにレンダリングされれば完了です。

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

評価

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

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

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