I have a node defined as frontpage, and there are HTML anchors on this frontpage.

I define top level menu item as /myfront
and second top level item as /myfront#anchor1

when clicking on anchor1 link, it will not receive is-active or active-trail classes, and the first menu item /myfront is incorrectly shown as is-active / active-trail

Comments

manarak created an issue. See original summary.

  • mehrpadin committed e96b2ec on 8.x-1.x
    Issue #2961604 by manarak: Anchor links not correctly set with is-active...
mehrpadin’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

drupaldope’s picture

so... this issue is fixed?

marassa’s picture

This fix breaks more than it fixes in my book.
I have a number of anchor links on my menu all pointing to different anchors on the same page. Up to 8.x-1.3 none of those links were .is-active (= all were underlined when hovered over and clickable) which was ok with me (even though making the currently active anchor link .is-active would be neat).
But now ALL of them are .is-active (= NOT underlined when hovered over) which confuses the user big time.

drupaldope’s picture

@ndlarge
the new/fixed behavior with anchor links allows for better css control.
you can use javascript to remove and add is-active and active-trail classes as needed.