Navbar with scroll effect and dropdown menu

For example template agency:
The navigation works responsively.
When I add an additional dropdown menu, I can’t open it on my phone - I see it for 1 second and it disappears again.

It’s easy to reproduce:
New design - Template Agency - Navbar - add dropdown - preview - shrink browser to SM and then try to open the dropdown menu.

I’ve already tried it with the additional js:

item.addEventListener(‘click’, function (event) {
var isDropdownItem = this.closest(‘.dropdown’);

  if (!isDropdownItem) {
    collapse.hide();
  }

});`

Then the dropdown menu opens, but the navbar scrolling effect is gone.

Do you have a solution for this?

Thank you very much and best regards

In the agency.js replace the if (navbarCollapse) {...}
with this

if (navbarCollapse) {
      var collapse = new bootstrap.Collapse(navbarCollapse, {
        toggle: false,
      });

      var navbarItems = navbarCollapse.querySelectorAll('a:not(.dropdown-toggle)');

      // Closes responsive menu when a scroll trigger link is clicked
      for (var item of navbarItems) {
        item.addEventListener('click', function (event) {
          if (event.target.classList.contains('.dropdown-toggle')) return;
          collapse.hide();
        });
      }
    }

It works,

Thank you very much !
:grinning: :ok_hand: :+1: