Problem/Motivation

When a main-navigation parent menu item is a nolink (a parent that has children but no URL — Drupal's <nolink> route), bs_base renders it as a plain <span>:

<span class="nav-link"><span class="label dropdown-toggle">Der Verband</span></span>

Because this is a <span> with no href, two problems follow:

  1. Wrong cursor. The <span> shows the default text caret on hover, so the clickable dropdown toggle does not read as clickable (a real a.nav-link would show a pointer).
  2. Click navigates to /undefined. With navbar_opened_submenu_behavior: visit, clicking an already-open toggle fires hide.bs.dropdown, and Drupal.bs_base.navbar.followLink() runs window.location = link.href. A nolink <span> has no href, so link.href is undefined and the browser navigates to /undefined (404).

Steps to reproduce

  1. A second-level-dropdown navbar with navbar_opened_submenu_behavior: visit.
  2. A top-level menu item using <nolink> (children, no URL).
  3. Hover the parent → text caret instead of a pointer.
  4. Open its dropdown, then click the parent again → navigates to /undefined.

Proposed resolution

  1. Drupal.bs_base.navbar.followLink() — bail out when the element has no href (a nolink toggle has no destination to follow).
  2. CSS — .navbar-nav span.nav-link { cursor: pointer; } so nolink toggles read as clickable.

Both changes touch js/navbar.js and sass/components/partials/_navbar.scss (see the MR).

Issue fork bs_base-3609544

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pivica created an issue. See original summary.

  • pivica committed b0788173 on 2.0.x
    fix: #3609544 Nolink parent menu items: missing pointer cursor and click...
pivica’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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