Problem/Motivation

The core drupal.active-link library adds a JS file which checks data attributes to se a "is-active" class on the links.

This class is not in a parameter or a variable. Should we replace completely this JS file to have the JS set the "active" class instead?

The "active" class is the one expected by navbar

Add the .active class on .nav-link to indicate the current page.
Please note that you should also add the aria-current attribute on the active .nav-link.

This would also maybe remove the need to have the addActiveClass method in src/HookHandler/PreprocessMenu? To test.

Proposed resolution

Remaining tasks

Evaluate completely this JS file, it should not remove the "active" class in some component not related to menus/links and where it is set based on props.

Decide what to do.

User interface changes

API changes

Data model changes

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

Grimreaper created an issue. See original summary.

grimreaper’s picture

grimreaper’s picture

Title: Override drupal.active-link library? » Override drupal.active-link library
Status: Active » Postponed
Issue tags: -JavaScript +JavaScript

Postponed until #3437139: LinksSettingType: add attributes of the link generator is merged and a new release is done.

Will need to increase minimum version of ui_patterns_settings.

grimreaper’s picture

Assigned: Unassigned » grimreaper
Status: Postponed » Needs work
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Fixed

  • Grimreaper committed 617a1690 on 5.0.x
    Issue #3426391 by Grimreaper: Override drupal.active-link library
    

Status: Fixed » Closed (fixed)

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