Main nav submenus fire on click rather than hover

Created on 27 February 2024, 9 months ago
Updated 28 February 2024, 9 months ago

On my main navigation, I had the submenus triggering using click rather than hover for a variety of reasons.
On the 2.0.1 cleanup, console started to produce: i.createPopper is not a function errors (I believe popper was removed from D10 core). The menus would only open on hover.

I had to create a subtheme and add: //cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js to include bootstrap with popper but now it is calling both:
//cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.min.js and //cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js

However, I can now get my menus to trigger on click again since the bundle with popper is loading. I read that Bootstrap has dropdowns explicitly triggering on click and not on hover (https://getbootstrap.com/docs/5.3/components/dropdowns/#overview). Wondering why main nav isn't implemented as such in Belgrade and is there a way to use this native functionality rather than by me adding the bundle (popper) and additional css. I'm not a developer so just trying to piece this together.

πŸ’¬ Support request
Status

Active

Version

2.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States djween

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

Comments & Activities

  • Issue created by @djween
  • πŸ‡·πŸ‡ΈSerbia majmunbog

    Thanks @djween for bringing up this issue.
    I don't think that Popper.js was ever included in core. The Belgrade CSS is responsible for displaying the dropdowns on hover.

    I agree that the dropdowns should be opening on click. However, according to the Belgrade design, the main menu is intended to open on hover.

    I'm currently considering two options:

    1. Specifying hover-based dropdown CSS exclusively for this menu.
    2. Implementing theme settings to toggle the global dropdown behavior between hover and click.
Production build 0.71.5 2024