More then one menu item has active class

Created on 17 May 2024, about 1 month ago
Updated 20 May 2024, about 1 month ago

Problem/Motivation

While going through the theme and added the data and the menu links I found out that more than one menu link has having is-active class which should not be the case.

Steps to reproduce

Install the theme and add content and some menu links and you will be able to see more than one menu link that has having is-active class added because of which you will be able to see the underline to the menu link.

Proposed resolution

is-active should only be present to the active menu item which can be one at a time.

Remaining tasks

none

User interface changes

yes

API changes

none

Data model changes

none

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇮🇳India Hamid.ali

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

Comments & Activities

  • Issue created by @Hamid.ali
  • Status changed to RTBC about 1 month ago
  • 🇮🇳India Jaydev Bhatt Pune, Maharashtra

    The issue you're experiencing with the `is-active` class on the `` links is due to Drupal's behavior of automatically applying this class when you are on the front page and the menu items are linked to ``. This is expected behavior for Drupal, as observed in several cases.

    To test the is-active functionality correctly, ensure your menu links point to different URLs rather than . When the links point to unique pages, the is-active class will apply appropriately based on the current page URL.

    For more information on this behaviour, you can check discussions and solutions on Drupal forums and StackExchange​ (Drupal Answers)​.

  • 🇮🇳India Hamid.ali

    @Jaydev Sure thanks. By updating the URLs links are working as expected.

Production build 0.69.0 2024