mat-menu nested with open and close with mouseenter and mouseleave

34 views
Skip to first unread message

dongjin son

unread,
Jan 27, 2024, 4:04:57 AMJan 27
to angular-material2
I want to make mat-menu to open and close dropdown menu without button click. 
I can fined the following sample code

https://stackblitz.com/edit/mat-nested-menu-yclrmd?embed=1&file=app/nested-menu-example.html

, but when I tried to use it from angular 17 (angular-material 17), I see the following exception

ERROR TypeError: Cannot read properties of undefined (reading '_elementRef')

from 

this.ren.removeClass(
trigger.menu.items.first['_elementRef'].nativeElement,
'cdk-focused'
);

I'm new to Angular, and can someone know what can be the cause of this issue?

Thank you!



Reply all
Reply to author
Forward
0 new messages