You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(MatDialog): When opening multiple dialogs in a short amount of time, some of them do not open #24037
AccessibilityThis issue is related to accessibility (a11y)P2The issue is important to a large percentage of users, with a workaroundarea: material/dialog
We've also hit this issue. I'm sure it was introduced with this commit. There's a comment on it that points to the underlying issue.
The commit message says the goal is to [a]void opening multiple of the same dialog before animations complete by returning the previous MatDialogRef, but the change does not check whether the two dialogs are the same. This leads to really weird behaviour, which took us a long time to figure out. Here's our use case (which was working fine before):
// injected in real codedeclareconstdialog: MatDialog;// somewhere in the codebaseconstdialogA=dialog.open(DialogA);// dialog that shows a spinner while async thing A is happening// somewhere else in codebase, gets executed as part of A succeeding but can fail independentlyconstdialogB=dialog.open(DialogB);// dialog that shows an errordialogB.afterClosed().pipe(/* do stuff according to user response */);
The way the timing works out in our case, dialogB will sometimes be a reference to DialogB (MatDialogRef<DialogB>, as guaranteed by the typing of open()), but mostly it will be a reference to DialogA and (more crucially) dialog B wasn't opened and we're processing a response that was given for the other dialog.
Any chance you could take another look at this, @Splaktar?
If I had a StackBlitz for this, I could try out a few quick things right now and see if I can provide a workaround, but since I don't, I probably won't have time to look into this again this week.
@aikrez okay, I do have an update. There have been some undesirable side effects of this change in the presubmit tests. They are being investigated and potential solutions and workarounds are being evaluated.
It seems like opening a dialog from within another dialog also fails if there happened to be an error shortly before (within the animation duration). I cannot listen on "dialogOpened" observable, as this only triggers once, but the error will trigger the dialogContainer.start animation again.
I reworked the fix for this on Friday to make it easier to merge and got it passing all the internal checks. It'll be merged in on Monday and should be out in the next patch release.
Reacted by Guilherme Meinlschmiedt Abdo and Pim de Jong
AccessibilityThis issue is related to accessibility (a11y)P2The issue is important to a large percentage of users, with a workaroundarea: material/dialog
Activity
hijamoya commentedon Dec 1, 2021
We encounter the same issue, If we call open in ngOnInit like below:
The dialog dose not open anymore, it is fine in previous version.
However, if we just:
The dialog will be opened correctly.
lephyrus commentedon Dec 2, 2021
We've also hit this issue. I'm sure it was introduced with this commit. There's a comment on it that points to the underlying issue.
The commit message says the goal is to [a]void opening multiple of the same dialog before animations complete by returning the previous
MatDialogRef, but the change does not check whether the two dialogs are the same. This leads to really weird behaviour, which took us a long time to figure out. Here's our use case (which was working fine before):The way the timing works out in our case,
dialogBwill sometimes be a reference toDialogB(MatDialogRef<DialogB>, as guaranteed by the typing ofopen()), but mostly it will be a reference toDialogAand (more crucially) dialog B wasn't opened and we're processing a response that was given for the other dialog.Any chance you could take another look at this, @Splaktar?
Splaktar commentedon Dec 2, 2021
Thank you for the example code. It would be great if you could provide a runnable StackBlitz to help us investigate this more efficiently.
fix(material/dialog): improve screen reader support when opened (#23085)
Splaktar commentedon Dec 2, 2021
Does this still happen when you import
NoopAnimationsinstead ofBrowserAnimations?components/src/material/dialog/dialog.ts
Lines 467 to 468 in 0b02322
Splaktar commentedon Dec 2, 2021
@lephyrus there is a lot of discussion about the tradeoffs and issues that we faced here in the following PRs
Splaktar commentedon Dec 2, 2021
If I had a StackBlitz for this, I could try out a few quick things right now and see if I can provide a workaround, but since I don't, I probably won't have time to look into this again this week.
30 remaining items
rasoulMrz commentedon Feb 26, 2022
Any updates?
P-de-Jong commentedon Mar 2, 2022
Would like to know too when this PR is getting merged. We're having a lot of problems with this issue at the moment 😢
proggler23 commentedon Mar 3, 2022
It seems like opening a dialog from within another dialog also fails if there happened to be an error shortly before (within the animation duration). I cannot listen on "dialogOpened" observable, as this only triggers once, but the error will trigger the dialogContainer.start animation again.
fix(material/dialog): don't wait for animation before moving focus
crisbeto commentedon Mar 5, 2022
I reworked the fix for this on Friday to make it easier to merge and got it passing all the internal checks. It'll be merged in on Monday and should be out in the next patch release.
fix(material/dialog): don't wait for animation before moving focus (#…
fix(material/dialog): don't wait for animation before moving focus (#…
DoodahProductions commentedon Mar 8, 2022
Hello, thanks for this fix !
I'm not sure what npm package I should update to fetch this fix, may you help me ? Thanks :)
crisbeto commentedon Mar 9, 2022
The fix will be in
@angular/material, but we haven't made a release with the new code yet. It should be out later today/tomorrow.Splaktar commentedon Mar 10, 2022
This fix is included in 13.2.6 and 14.0.0-next.6.
P-de-Jong commentedon Mar 11, 2022
We have updated our applications to the new patch and everything seems to work as intended. Thanks!
fix(material/dialog): don't wait for animation before moving focus (a…
angular-automatic-lock-bot commentedon Apr 11, 2022
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.