Clear Error
Collapse
Expand
Menu Focus Change (Deprecated)
Menu Select (Deprecated)
Menu Trigger Press (Deprecated)
Validation Error (Deprecated)
LWC Developer Guide
SLDS 1
SLDS 2
ui:menuFocusChange
Deprecated as of API version 47.0. Use lightning:buttonMenu instead.
This event is fired when you scroll up and down the ui:menuList component, which triggers a focus change in menu items. To set a handler for the ui:menuFocusChange event, use the menuFocusChange attribute on ui:menuList.
The following example shows a menu with two list items. The handleChange client-side controller handles the ui:menuFocusChange event.
1<aura:component>
2 <ui:menu>
3 <ui:menuTriggerLink aura:id="trigger" label="Contacts" />
4 <ui:menuList class="actionMenu" aura:id="actionMenu" menuFocusChange="{!c.handleChange}">
5 <ui:actionMenuItem aura:id="item1" label="All Contacts" />
6 <ui:actionMenuItem aura:id="item2" label="All Primary" />
7 </ui:menuList>
8 </ui:menu>
9</aura:component>If you’re using this event with a component other than ui:menuList, register the event first.
1<aura:registerEvent
2 name="menuFocusChange"
3 type="ui:menuFocusChange"
4 description="The event fired when the menu list focus changes from one menu item to another."
5/>| Name | Description | Type | Default | Required |
|---|---|---|---|---|
currentItem | The menu item that’s currently focused. | component[] | ||
previousItem | The menu item that’s previously focused. | component[] |