-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(mat-menu): Clicking a [matMenuTriggerFor] inside its own mat-menu crashes JS #19941
Labels
area: material/menu
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Comments
tomasdev
changed the title
bug(mat-menu): Having a [matMenuTriggerFor] inside its own mat-menu crashes JS
bug(mat-menu): Clicking a [matMenuTriggerFor] inside its own mat-menu crashes JS
Jul 10, 2020
crisbeto
added
area: material/menu
has pr
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
and removed
needs triage
This issue needs to be triaged by the team
labels
Jul 10, 2020
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jul 10, 2020
If the consumer puts a trigger inside a menu and passes the menu back to the trigger, we'll go into an infinite loop and throw a cryptic error message. These changes detect such a case and throw a better error. Example of a case that will be flagged: ``` <mat-menu #menu="matMenu"> <button [matMenuTriggerFor]="menu"></button> </mat-menu> ``` Fixes angular#19941.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jul 12, 2020
If the consumer puts a trigger inside a menu and passes the menu back to the trigger, we'll go into an infinite loop and throw a cryptic error message. These changes detect such a case and throw a better error. Example of a case that will be flagged: ``` <mat-menu #menu="matMenu"> <button [matMenuTriggerFor]="menu"></button> </mat-menu> ``` Fixes angular#19941.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Jul 12, 2020
If the consumer puts a trigger inside a menu and passes the menu back to the trigger, we'll go into an infinite loop and throw a cryptic error message. These changes detect such a case and throw a better error. Example of a case that will be flagged: ``` <mat-menu #menu="matMenu"> <button [matMenuTriggerFor]="menu"></button> </mat-menu> ``` Fixes angular#19941.
wagnermaciel
pushed a commit
that referenced
this issue
Jul 24, 2020
If the consumer puts a trigger inside a menu and passes the menu back to the trigger, we'll go into an infinite loop and throw a cryptic error message. These changes detect such a case and throw a better error. Example of a case that will be flagged: ``` <mat-menu #menu="matMenu"> <button [matMenuTriggerFor]="menu"></button> </mat-menu> ``` Fixes #19941.
wagnermaciel
pushed a commit
that referenced
this issue
Jul 24, 2020
If the consumer puts a trigger inside a menu and passes the menu back to the trigger, we'll go into an infinite loop and throw a cryptic error message. These changes detect such a case and throw a better error. Example of a case that will be flagged: ``` <mat-menu #menu="matMenu"> <button [matMenuTriggerFor]="menu"></button> </mat-menu> ``` Fixes #19941. (cherry picked from commit 1b7ba0b)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
wagnermaciel
pushed a commit
to wagnermaciel/components
that referenced
this issue
Jan 14, 2021
If the consumer puts a trigger inside a menu and passes the menu back to the trigger, we'll go into an infinite loop and throw a cryptic error message. These changes detect such a case and throw a better error. Example of a case that will be flagged: ``` <mat-menu #menu="matMenu"> <button [matMenuTriggerFor]="menu"></button> </mat-menu> ``` Fixes angular#19941.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: material/menu
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Note: This might be an invalid use case, as it's wrongly using a directive. Still, it wouldn't hurt to have a safety check to prevent this.
Reproduction
Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-japg2m?file=src%2Fapp%2Fmenu-overview-example.html
Steps to reproduce:
Expected Behavior
Page (main JS thread) shouldn't crash when having a closing button inside the menu.
Actual Behavior
Page (main JS thread) crashes.
Environment
The text was updated successfully, but these errors were encountered: