Problem/Motivation

When you navigate with the main menu, the "active" class remains on previously viewed menu links

Steps to reproduce

1. Install the Radix 6.x theme
2. Add 3-4 items to the main menu
3. Make sure that the Drupal render cache is not disabled in your settings.php with

$settings['cache']['bins']['render'] = 'cache.backend.null';

4. Navigate to one of the menu links. It should get the "active" class.
5. Navigate to another menu link. The "active" class will remain on the previously viewed menu link.

Example screenshot

Screenshot showing active class on previous menu link

CommentFileSizeAuthor
#4 Active menu.jpeg169.86 KBricharddavies

Issue fork radix-3482542

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

muffinzap created an issue. See original summary.

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

danchadwick’s picture

Version: 6.0.0-rc6 » 6.0.x-dev
Status: Active » Closed (cannot reproduce)

There were a couple of issues related to menu links and classes. Could you please try the latest dev and re-open this issue if the problem persists. I cannot reproduce any issue on the latest dev.

richarddavies’s picture

Title: Active menu link class » Active menu link class not updating
Version: 6.0.x-dev » 6.0.8
Issue summary: View changes
Status: Closed (cannot reproduce) » Active
StatusFileSize
new169.86 KB

Reopening because I'm also having this same issue with Radix 6. I've reproduced it on 6.0.0, 6.0.5, and 6.0.8. (I suspect it's been an issue with all 6.x versions, but somehow I failed to notice it until now because it's only an issue when the render cache is enabled, but I tend to test things with that cache disabled on my local environment.

I've updated the issue description and steps to reproduce with more details.

  • doxigo committed 8dcc9c2d on 6.0.x
    fix: #3482542 Active menu link class not updating
    
doxigo’s picture

Status: Active » Fixed

Thanks everyone, this is fixed on the latest 6.0.x dev release for now

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.