Tab Focused

lightning:tabFocused

Fires when a Console workspace or subtab is focused.

For Use In

Lightning Experience

lightning:tabFocused is an application event that indicates a successful tab focus change. The event fires when any tab is successfully focused. This event is supported only in Lightning console apps.

lightning:tabFocused fires whenever a user selects a workspace tab or subtab, so console navigation users frequently trigger this application event in typical use. This event also fires when going from a tab to a navigation item, or going from a navigation item to a tab.

Aura application events notify all listeners registered in the default phase, including listeners in background tabs. Multiple listeners responding at the same time can impact performance.

To minimize performance impact, use a background utility item as the only listener, or use a custom component event instead.

Handle the event using aura:handler.

In your client-side controller, retrieve the ID of the tab that's currently focused.

For more information, see the Salesforce Console Developer Guide.

NameDescriptionTypeDefaultRequired
currentTabIdThe currently focused tab ID.stringYes
previousTabIdThe previously focused tab ID.stringYes