Problem/Motivation

The menu IA is really complex, and when you load a new page you loose the context where you where and the sidebar loads the menu closed.

Proposed resolution

When you load a page, if you are in a place an that is adding the active state/class somewhere it should ideally scroll the sidebar to there, meaning it should be visible on the viewport.

Issue fork navigation-3375854

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.

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

utkarsh_33’s picture

Assigned: Unassigned » utkarsh_33

lauriii’s picture

Status: Active » Needs review
utkarsh_33’s picture

Assigned: utkarsh_33 » Unassigned

  • lauriii committed 65d97805 on 1.x authored by Utkarsh_33
    Issue #3375854: Scroll the sidebar to the active item when loading the...
lauriii’s picture

Status: Needs review » Fixed

Thank you @Utkarsh_33!

mherchel’s picture

Note this can also be accomplished with https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView, which doesn't require a re-layout operation from getBoundingClientRect()

Status: Fixed » Closed (fixed)

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