Problem/Motivation

When visiting /admin/structure/block-content, 2 items get the active state on the Navigation:

The problem relies in that both "Block layout" and "Block types" pages share a part of their menu structure:

  • Block layout: admin/structure/block
  • Block types: admin/structure/block<strong>-content</strong>

So basically in /js/toolbar-menu.js we are checking:

if (document.URL.includes(link.href)) {

which is basically true. But it should exclude any result that "includes" plus has more info.

Proposed resolution

Adjust the JS assigning the active state.

CommentFileSizeAuthor
active-url.png83.08 KBckrina

Issue fork navigation-3414127

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

ckrina created an issue. See original summary.

kostyashupenko made their first commit to this issue’s fork.

kostyashupenko’s picture

Status: Active » Needs review
kostyashupenko’s picture

Can't guess a case when `document.URL === link.href` can be failed
Even if we have `?` queries

ckrina’s picture

Status: Needs review » Reviewed & tested by the community
ckrina’s picture

Status: Reviewed & tested by the community » Fixed

Yeah I can't think of one right now, but if we find it let's open a new issue for it then. Thanks!

Status: Fixed » Closed (fixed)

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