@@ -56,6 +56,11 @@ type MenuItemClickEventDetail = {
56
56
type MenuBeforeOpenEventDetail = { item ?: MenuItem } ;
57
57
type MenuBeforeCloseEventDetail = { escPressed : boolean } ;
58
58
59
+ type MenuItemFocusEventDetail = {
60
+ ref : HTMLElement ,
61
+ item : MenuItem ,
62
+ } ;
63
+
59
64
type OpenerStandardListItem = StandardListItem & { associatedItem : MenuItem } ;
60
65
61
66
/**
@@ -184,6 +189,32 @@ type OpenerStandardListItem = StandardListItem & { associatedItem: MenuItem };
184
189
* @since 1.10.0
185
190
*/
186
191
@event ( "after-close" )
192
+
193
+ /**
194
+ * Fired when a menu item receives focus.
195
+ *
196
+ * @public
197
+ * @param { HTMLElement } ref The currently focused element representing a <code>ui5-menu-item</code>.
198
+ * @param { HTMLElement } item The <code>ui5-menu-item</code> represented by the focused element.
199
+ * @since 1.23.1
200
+ */
201
+ @event < MenuItemFocusEventDetail > ( "item-focus" , {
202
+ detail : {
203
+ /**
204
+ * @public
205
+ */
206
+ ref : {
207
+ type : HTMLElement ,
208
+ } ,
209
+ /**
210
+ * @public
211
+ */
212
+ item : {
213
+ type : HTMLElement ,
214
+ } ,
215
+ } ,
216
+ } )
217
+
187
218
class Menu extends UI5Element {
188
219
/**
189
220
* Defines the header text of the menu (displayed on mobile).
@@ -539,7 +570,7 @@ class Menu extends UI5Element {
539
570
: ( target . getRootNode ( ) as ShadowRoot ) . host as MenuListItem ;
540
571
const item = menuListItem . associatedItem as MenuItem ;
541
572
const mainMenu = this . _findMainMenu ( item ) ;
542
- mainMenu ?. fireEvent ( "item-focus" , { ref : menuListItem , item } ) ;
573
+ mainMenu ?. fireEvent < MenuItemFocusEventDetail > ( "item-focus" , { ref : menuListItem , item } ) ;
543
574
}
544
575
545
576
_startOpenTimeout ( item : MenuItem , opener : OpenerStandardListItem ) {
@@ -712,4 +743,5 @@ export type {
712
743
MenuItemClickEventDetail ,
713
744
MenuBeforeCloseEventDetail ,
714
745
MenuBeforeOpenEventDetail ,
746
+ MenuItemFocusEventDetail ,
715
747
} ;
0 commit comments