dropdown menu not working

Created on 30 January 2023, almost 2 years ago
Updated 19 April 2023, over 1 year ago

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

🐛 Bug report
Status

Closed: works as designed

Version

3.3

Component

User interface

Created by

🇵🇪Peru omarvs91

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @omarvs91
  • 🇳🇱Netherlands thomas.dutch

    We are experiencing the same issue after updating Admin Toolbar. When logged out, the dropdown menu works. When logged in the dropdown menu does not open without any errors in the console or Drupal log.

  • 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.

  • 🇳🇱Netherlands thomas.dutch

    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

  • Status changed to Closed: works as designed over 1 year ago
Production build 0.71.5 2024