Problem/Motivation

After updating admin toolbar from 8.x-2.5 to 3.3.0 I found out that the dropdown menu is not showing up on the frontend no matter if I clean the cache or refresh the page, but it only works when I'm on the admin pages.
dblogs does not show any error regarding this and the browser console either.

Steps to reproduce

update admin toolbar from 8.x-2.5 to 3.3.0

CommentFileSizeAuthor
#5 dropdown.mp412.87 MBHarish1688

Comments

omarvs91 created an issue. See original summary.

omarvs91’s picture

Issue summary: View changes
omarvs91’s picture

Issue summary: View changes
thomas.dutch’s picture

We are experiencing the same issue after updating to 3.3.0. When logged out, the dropdown menu works. When logged in the frontend dropdown menu does not open. No errors in the console or Drupal log. A class which should be toggled to display the menu is not toggling anymore.

Update: after uninstalling Admin Toolbar the issue still persists. We updated Drupal core and Smart Trim, so those two would be the main suspects then.

Harish1688’s picture

StatusFileSize
new12.87 MB

Hi,

Tried to reproduced the issue on local, turned the version in 8.x-2.5 to 3.3.0, but not find any dropdown issue with admin toolbar. attached a video where everything working fine dropdown.mp4 .

can you provide more info like screenshot, video to reproduce this.

thomas.dutch’s picture

Hi Harish1688,

Thank you for your response. The issue has been resolved by using the core/once library for the custom hover menu, eg:

- (function(Drupal) {
+ (function(Drupal, drupalSettings, once) {

- const toggleElements = context.getElementsByClassName("navbar-toggler");
- Array.from(toggleElements).forEach(element => {
+ const toggleElements = once("navbar-toggler", ".navbar-toggler", context);
+ toggleElements.forEach(element => {

Regards,

Thomas

thomas.dutch’s picture

Priority: Critical » Normal
Status: Active » Closed (works as designed)