isSubtab() for Lightning Experience
Checks whether a tab is a subtab. This method works only in Lightning console apps. This method isn’t supported for Lightning Web Components (LWC).
To check whether a tab is a subtab in LWC, use getTabInfo().
| Name | Type | Description |
|---|---|---|
tabId | string | ID of the tab. |
This component has a button that checks whether the focused tab is a subtab and opens a modal with the answer.
Component code:
Controller code:
This method returns a promise that, upon success, resolves to true if the tab is a subtab, and false otherwise.