@@ -51,7 +51,7 @@ import {Directionality} from '@angular/cdk/bidi';
5151 '(click)' : '_pattern.onClick()' ,
5252 '(keydown)' : '_pattern.onKeydown($event)' ,
5353 '(focusout)' : '_pattern.onFocusOut($event)' ,
54- '(focusin)' : 'onFocusIn()' ,
54+ '(focusin)' : '_pattern. onFocusIn()' ,
5555 } ,
5656} )
5757export class MenuTrigger < V > {
@@ -67,9 +67,6 @@ export class MenuTrigger<V> {
6767 /** The menu associated with the trigger. */
6868 menu = input < Menu < V > | undefined > ( undefined ) ;
6969
70- /** Whether the menu item has been focused. */
71- readonly hasBeenFocused = signal ( false ) ;
72-
7370 /** Whether the menu is expanded. */
7471 readonly expanded = computed ( ( ) => this . _pattern . expanded ( ) ) ;
7572
@@ -86,11 +83,6 @@ export class MenuTrigger<V> {
8683 constructor ( ) {
8784 effect ( ( ) => this . menu ( ) ?. parent . set ( this ) ) ;
8885 }
89-
90- /** Marks the menu trigger as having been focused. */
91- onFocusIn ( ) {
92- this . hasBeenFocused . set ( true ) ;
93- }
9486}
9587
9688/**
@@ -205,7 +197,7 @@ export class Menu<V> {
205197 this . _deferredContentAware ?. contentVisible . set ( true ) ;
206198 } else {
207199 this . _deferredContentAware ?. contentVisible . set (
208- this . _pattern . isVisible ( ) || ! ! this . parent ( ) ?. hasBeenFocused ( ) ,
200+ this . _pattern . isVisible ( ) || ! ! this . parent ( ) ?. _pattern . hasBeenFocused ( ) ,
209201 ) ;
210202 }
211203 } ) ;
@@ -339,7 +331,7 @@ export class MenuBar<V> {
339331 host : {
340332 'role' : 'menuitem' ,
341333 'class' : 'ng-menu-item' ,
342- '(focusin)' : 'onFocusIn()' ,
334+ '(focusin)' : '_pattern. onFocusIn()' ,
343335 '[attr.tabindex]' : '_pattern.tabIndex()' ,
344336 '[attr.data-active]' : 'isActive()' ,
345337 '[attr.aria-haspopup]' : 'hasPopup()' ,
@@ -404,11 +396,6 @@ export class MenuItem<V> {
404396 constructor ( ) {
405397 effect ( ( ) => this . submenu ( ) ?. parent . set ( this ) ) ;
406398 }
407-
408- /** Marks the menu item as having been focused. */
409- onFocusIn ( ) {
410- this . hasBeenFocused . set ( true ) ;
411- }
412399}
413400
414401/** Defers the rendering of the menu content. */
0 commit comments