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
The previous version in which this bug was not present was
Unknown.
Description
MenuPanels cannot be closed when they do not have an active trigger set.
A scenario where unsetting the trigger during runtime may be wanted is when the button is meant to open a context menu or a bottom sheet depending on the size of the viewport and so needs to switch between a click handler (that opens a bottom sheet) or a matMenu Trigger that opens a menu panel during runtime. An example application has been setup for such a scenario (without the click handler, just temporarily setting the menu trigger to null during runtime)
Additionally - it seems that when mat-menu-items are projected into a MatMenuPanel via ng-content - tabbing into a mat menu item makes them lose focus, but that is a separate issue it seems.
Is this a regression?
No.
The previous version in which this bug was not present was
Unknown.
Description
MenuPanels cannot be closed when they do not have an active trigger set.
A scenario where unsetting the trigger during runtime may be wanted is when the button is meant to open a context menu or a bottom sheet depending on the size of the viewport and so needs to switch between a click handler (that opens a bottom sheet) or a matMenu Trigger that opens a menu panel during runtime. An example application has been setup for such a scenario (without the click handler, just temporarily setting the menu trigger to null during runtime)
Reproduction
StackBlitz link: https://stackblitz.com/edit/ku1ehf?file=src%2Fexample%2Fmenu-icons-example.html
Steps to reproduce:
Expected Behavior
The menu panel closes when an option is selected or anywhere within the app window outside the menu panel is clicked.
Actual Behavior
When the trigger to open the menu is lost - the menu panel can no longer close until it regains a trigger.
Environment
The text was updated successfully, but these errors were encountered: