Determines whether the utility is in a popped-out state. This method isn’t supported for Lightning Web Components (LWC).
To check if a utility is in a popped-out state with LWC, use getInfo() for Lightning Experience.
Arguments
None
Sample Code
This component has a button that, when pressed, states whether the current utility is popped out or not.
Component code:
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
<lightning:utilityBarAPI aura:id="utilitybar" />
<lightning:button label="Is Utility popped out?" onclick="{! c.handleIsUtilityPoppedOut }" />
<lightning:textarea label="Popped out?" aura:id="textarea" />
</aura:component>
Controller code:
({
handleIsUtilityPoppedOut : function(component, event, helper) {
var utilityBarAPI = component.find("utilitybar");
utilityBarAPI.isUtilityPoppedOut().then(function(response) {
component.find('textarea').set('v.value', response);
})
.catch(function(error) {
console.log(error);
});
}
})
Response
This method returns a promise that, upon success, resolves to true if the utility is popped out, and false otherwise.