Apparently there is no method (at this point) for detecting when the utility bar item minimize / maximize event is fired.

I could potentially use jQuery to listen for a click on the button, but everything I'm reading advises against adding any jQuery event listeners like onClick event, and the "minimize" button's classes may change regardless...

Does anyone have any thoughts?

example minimize / toggle utility bar in lightning console


Apparently, there's no events for utility bar components, but we do have the ability to get a hold of the current state of the item, which allows us to poll for changes:

<lightning:utilityBarAPI aura:id="utilitybar" />


setInterval($A.getCallback(function() {
  component.find("utilitybar").getUtilityInfo().then(function(result) {
    if(result.utilityVisible) {
      // we're currently open
    } else {
      // we're minimized
}), 1000); // check every second

You can also check panelHeight and panelWidth for the current dimensions of the panel. Store the results in an attribute if you want to check the differences.

Try not to poll too frequently, as it may cause user interface lag. I'm considering this to be kind of a last-resort sort of deal, because it shouldn't be necessary, but this is as close as we get.

  • If SF is opened in multiple browser tabs, and each tab is polling then thing can get super crazy – Pranay Jaiswal Nov 27 '18 at 18:40
  • 1
    @PranayJaiswal It would be so simple to have events for this, but ... well, it didn't happen. I hate polling, because this is 2018, not 1996, but maybe they'll sort it out sooner or later. – sfdcfox Nov 27 '18 at 18:41
  • 1
    I am checking the Transactions tab in lightning inspector. Two events ltng:interaction [synthetic-click:one-utilityBarItem--panelMinimized] and ltng:interaction [synthetic-click:one-utilityBarItem--panelOpened] are fired. I dont know if they can be capture. – Pranay Jaiswal Nov 27 '18 at 18:47
  • 1
    @PranayJaiswal The events we're allowed to listen to are documented. If they're not documented, we can't use them. I haven't tried these ones in particular, but I have tried others. They simply never come through. – sfdcfox Nov 27 '18 at 18:51
  • It looks like these interactions are stored in database, and can be queried in EventLogFile . EventLogFile does not support triggers yet.. if they did we could do much more by firing platform event and listening on UI amd then doing fancy stuff – Pranay Jaiswal Nov 27 '18 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.