Newer Version Available

This content describes an older version of this product. View Latest

ui:menuFocusChange

Indicates that the user changed menu item focus in a menu component.
For example, this event is fired when the user scrolls up and down the menu list, which triggers a focus change in menu items. The ui:menuList component registers this event and handles it when it’s fired.
1<aura:registerEvent name="menuFocusChange"  type="ui:menuFocusChange"
2                    description="The event fired when the menu list focus changes from one menu item to another." />

You can handle this event in a ui:menuList component instance. This example shows a menu component with two list items.

1<ui:menu>
2    <ui:menuTriggerLink aura:id="trigger" label="Contacts"/>
3        <ui:menuList class="actionMenu" aura:id="actionMenu"
4                     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>