-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/snack-bar
Description
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
12.0.0
Description
Opening the SnackBar more than once from a global error handler (https://angular.io/api/core/ErrorHandler) does not close previously opened SnackBars.
Reproduction
Steps to reproduce:
- Go to https://stackblitz.com/edit/angular-ivy-1uxyez
- Two errors are triggered, and two snackbar elements are in the DOM. Running
document.querySelectorAll('.mat-snack-bar-container')
will return both of them.
If you trigger a single error instead. This can be done by uncommenting line #13 of app.component.ts. It does work.
Expected Behavior
- The first snackbar is closed
- The second snackbar is opened
Actual Behavior
- Both snackbars are in the DOM
- The text is not readable, probably because of the overlapping DOM elements.
Environment
- Angular: 13.2.2
- CDK/Material: 13.2.0
- Browser(s): Chrome 98
- Operating System (e.g. Windows, macOS, Ubuntu): macOS
cotneit
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/snack-bar