diff --git a/app/design/adminhtml/Magento/backend/web/js/theme.js b/app/design/adminhtml/Magento/backend/web/js/theme.js
index 8e3b89dcf7e4e..39b364ea8553f 100644
--- a/app/design/adminhtml/Magento/backend/web/js/theme.js
+++ b/app/design/adminhtml/Magento/backend/web/js/theme.js
@@ -267,17 +267,18 @@ define('globalNavigation', [
if (subMenu.length) {
e.preventDefault();
}
-
- menuItem.addClass('_show')
- .siblings(menuItemSelector)
- .removeClass('_show');
-
- subMenu.attr('aria-expanded', 'true');
-
closeBtn.on('click', close);
- this.overlay.show(0).on('click', close);
- this.menuLinks.last().off('blur');
+ if ($(menuItem).hasClass('_show')) {
+ closeBtn.trigger('click');
+ } else {
+ menuItem.addClass('_show')
+ .siblings(menuItemSelector)
+ .removeClass('_show');
+ subMenu.attr('aria-expanded', 'true');
+ this.overlay.show(0).on('click', close);
+ this.menuLinks.last().off('blur');
+ }
},
/**