Is there a way to always hide the active toolbar item's menu on mobile? Because now it'll sometimes still show the active toolbar item's menu when switching pages. Not always but for example, when on admin/content and opening the menu Manage, but clicking on the Go back to site button, makes it so that it'll show the active toolbar item's (in this case Manage) navigation as open. (See screenshot)

Is this a setting I can change or is this not possible?

Comments

inge_dt created an issue. See original summary.

romainj’s picture

Sorry but I don't get it. Could you provide step-by-step instructions with screenshots?

seemas’s picture

hi inge_dt, did you find any solutions for this? I cannot find anything related and this seams to be annoying for more people.

ajay547’s picture

Hi seemas,

Possible solution of this scenario can be, we can hide the menu once the site is loaded in mobile device, and if hamburger menu is clicked then we can show that again.
Also this is not related to admin_toolbar module only (as per image attached in thread), instead it is default behaviour of vanilla drupal logged in as admin user.

seemas’s picture

Ok, still... Looking for other suggestions/solutions/patches. This is more complex than I expected. So need help from others.

neslee canil pinto’s picture

Status: Active » Needs review
StatusFileSize
new453 bytes

Hided active menu from mobile view

neslee canil pinto’s picture

Add this css in css/admin.toolbar.css
@media (max-width:767px) {
#toolbar-item-administration-tray {
display:none;
}
#toolbar-item-shortcuts-tray {
display:none;
}
#toolbar-item-user-tray {
display:none;
}
}

chris matthews’s picture

Version: 8.x-1.24 » 8.x-1.x-dev
chris matthews’s picture

Category: Bug report » Feature request

Bug report -> Feature request

chris matthews’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
neslee canil pinto’s picture

@adriancid, need a review on #6. Thanks.

adriancid’s picture

Status: Needs review » Needs work

Once I apply the patch I can't use anymore the menu and the code need to follow the coding standard.

rokzabukovec’s picture

Status: Needs work » Needs review
StatusFileSize
new507 bytes

I made a patch that always hides the dropdown menu. It doesn't rely on the width of the window but on the presence of the toolbar-tray-vertical class. I noticed a lot of CSS glitches when the toolbar is viewed on mobile but this I suppose is a different issue. Please review the patch.

  • adriancid committed c1e705f on 8.x-2.x authored by rokzabukovec
    Issue #2991056 by Neslee Canil Pinto, rokzabukovec, inge_dt, adriancid:...
adriancid’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ey’s picture

Category: Feature request » Bug report

This patch broke the menu that it hides the navigation on every page load also on desktops. This breaks the layout completely, since we use the navigation on the left side most of the time. Please revert this commit or make it configurable, or better make it only for mobile versions as this issue initially opened for.

adriancid’s picture

@Elin Yordanov I don't see any problem in Drupal 8 or Drupal9, can you open a new issue and add the steps to reproduce it?