Override drupal.active-link library

Created on 7 March 2024, 4 months ago
Updated 19 June 2024, 6 days ago

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

✨ Feature request
Status

Fixed

Version

5.0

Component

Code

Created by

πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024