Problem/Motivation

When I'm visiting a page that is linked as a level three menu item, I would expect both the level 1 and 2 items to be highlighting the active trail. This includes keeping the second level menu item open by default to be able to show the active menu item:

On top of this, we should make sure that the active trail is shown in the menu even when user is on a page that is not directly linked from the navigation. This was fixed recently in the core Toolbar module, which we could potentially use as an inspiration for the fix: #3371005: Toolbar doesn't indicate active menu trail for pages not included in Toolbar.

Steps to reproduce

Proposed resolution

Link to designs on Figma to see all the states.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork drupal-3438046

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:

Issue fork navigation-3438046

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

lauriii created an issue. See original summary.

abh1shek chauhan’s picture

Assigned: Unassigned » abh1shek chauhan

I am working on this issue.

abh1shek chauhan’s picture

Assigned: abh1shek chauhan » Unassigned
Status: Active » Needs review

Fixed the issue, please review.

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

ckrina’s picture

Moved the work to branch that follow naming conventions to avoid confusions.

ckrina’s picture

Issue summary: View changes
StatusFileSize
new20.04 KB

Apart from the feedback on the JS strategy, the active state should have the dark circle when it's active. You can explore the designs in Figma here. And I've added a link to the issue summary.

ckrina’s picture

Status: Needs review » Needs work
meghasharma’s picture

Assigned: Unassigned » meghasharma
meghasharma’s picture

Added dark circle to active state when it's active as per the figma design.
Please review
Thanks!

meghasharma’s picture

meghasharma’s picture

Assigned: meghasharma » Unassigned
Status: Needs work » Needs review
finnsky’s picture

Status: Needs review » Needs work

This should be rebased first i guess.

meghasharma’s picture

Assigned: Unassigned » meghasharma
meghasharma’s picture

Assigned: meghasharma » Unassigned
ckrina’s picture

Project: Navigation » Drupal core
Version: 1.x-dev » 11.x-dev
Component: Code » navigation.module
ckrina’s picture

Issue tags: +Portland2024

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

gauravvvv’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

With the js change believe something that should have test coverage.

finnsky’s picture

StatusFileSize
new110.63 KB

Thank you!
MR contains lot of css changes which breaks layout

alt

Also i believe it does not need rework of all JS, Cause all events already exist. Gonna check

finnsky’s picture

Status: Needs work » Needs review
StatusFileSize
new816.02 KB

It needs design and UI decision.

In the original version of the menu, we had limited space in the popover and closed the child menu when changing the popover. Now I think
this is completely unnecessary because there is enough space in the popover to display the children's menu open.

open child

This MR resolve it. But not works in case of deeper levels. We need to rewrite events system a bit to achieve this.

finnsky’s picture

Now works with any level of nesting.

ckrina changed the visibility of the branch 3438046-2nd-level-active to hidden.

finnsky’s picture

Status: Needs review » Needs work

We need to add extra css using `:has` selector

https://developer.mozilla.org/en-US/docs/Web/CSS/:has

Examples presented for higher levels of menu

sjothivelu’s picture

Hello,

I am looking into this.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.