Commit d6f6938
fix(dialog): Open from a trigger destroyed by the same click (#5344)
## Description
* A `lu-dropdown-action` opening a dialog no longer throws `NG0911`.
* The dialog closes again on backdrop click and Escape.
-----
* `provideLuDialog()` on `luDialogOpen` makes the service injector the
trigger's node injector.
* `lu-dropdown-action` disposes the panel on its own `(click)` before
`luDialogOpen` runs.
* `afterNextRender` then registers on the destroyed view and throws.
* The throw skips the backdrop and Escape close subscription.
* The new *Dropdown / Angular / Dialog* story covers the case.
Fixes #5342.
-----
### Contribution
- [x] Root cause of the bug is identified and understood
- [x] Bug is no longer reproducible
- [x] E2E test or UI diff is added if required
- [x] `npm run build` is OK
- [x] `npm run lint` is OK
### Functional review
- [x] UI diff is OK
- [x] All related impacted functionalities are manually tested and show
no regression
-----
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 7443ba7 commit d6f6938
2 files changed
Lines changed: 61 additions & 2 deletions
File tree
- packages/ng/dialog
- stories/documentation/overlays/dropdown/angular
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
72 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments