Feature (MatDialog): Add an option to prevent duplicate dialogs
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- angular, typescript
- 領域
- frontend
調査の方向性
Start by reading the MatDialog API and its existing openDialogs and getDialogById() behavior. The proposal leaves key behavior undecided, including whether to return the existing reference or ignore the request, and how duplicate detection should be customized. Done criteria would need maintainers to settle those choices and define how component type matching works.
索引モデルが issue の本文から書いたものです。
説明
Feature Description
Currently, Angular Material’s MatDialog allows the same component to be opened multiple times, resulting in multiple instances of the same dialog being displayed simultaneously.
In some applications, this behavior is undesirable. For example, repeated user interactions or multiple event emissions can accidentally open the same dialog more than once.
Developers must currently implement their own duplicate detection logic using MatDialog.openDialogs or MatDialog.getDialogById() before calling MatDialog.open().
Proposed solution
It would be useful to have a built-in option in MatDialogConfig to prevent duplicate instances of the same component from being opened.
For example:
this.dialog.open(MyDialogComponent, {
preventDuplicates: true,
});
When this option is enabled, attempting to open a component that already has an open dialog could either:
- Return the existing MatDialogRef without creating another instance.
- Ignore the new request and keep the existing dialog open.
The exact behavior could be determined by the maintainers.
Ideally, duplicate detection would be scoped to the component type, with an option to customize the behavior if needed.
Benefits
- Avoids accidentally opening multiple instances of the same dialog.
- Reduces repetitive boilerplate across applications.
- Provides a consistent, framework-level solution.
- Keeps applications simpler and less error-prone.
Alternatives considered
Currently, developers can manually inspect openDialogs or use getDialogById() before opening a dialog. However, this requires additional application-level logic and does not provide a straightforward, reusable option for this common use case.
Would this feature be a good fit for Angular Material’s MatDialog API? I’d be happy to contribute a PR if the maintainers consider this approach appropriate.
Use Case
No response
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 3日 7時間
- マージ済み PR(30日)
- 59
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angular/components のほかの issue
-
bug(aria/accordion): Enter/Space inside a panel toggles the accordion instead of activating the focused element対応中かも @agarwalU001 が 1 日前に担当しました。 オープンarea: aria/accordion gemini-triaged needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/components#34011 ·
メンテナーはふだん 1 日以内に返信
-
bug(aria/combobox): keys pressed back to back are lost; only the last one reaches the popup対応中かも @drakeo338 が 7 日前に担当しました。 オープンarea: aria/combobox gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
angular/components#33973 ·
メンテナーはふだん 1 日以内に返信
-
bug(material/sort): hover hint arrow on an unsorted header shows the active sort direction, not the resulting direction after click.対応中かも @lekhmanrus が 18 日前に担当しました。 オープンarea: material/sort P3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
angular/components#33933 ·
メンテナーはふだん 1 日以内に返信
-
bug(mat-date-picker): month shown twice in date picker対応中かも @PreethiPantangi が 36 日前に担当しました。 オープンarea: material/datepicker P4
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/components#33763 · コメント 2 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Bug in table.scss footer cell height: unset instead of footer row height unset対応中かも @minwookshin が 22 日前に担当しました。 オープンarea: material/table P4
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
angular/components#33709 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
angular/components の issue をすべて見る
似ている issue
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
redhat-developer/rhdh-plugin-export-overlays#4580 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
devdotfast/whiteboard#1415 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area/sessions comp/desktop desktop/sessions P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
NousResearch/hermes-agent#145383 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
enhancement p2 setup
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信