Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix placement of the .active class for dropdown items & remove dropdown when item has no visible children #530

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

IanDelMar
Copy link
Collaborator

Fixes #431 (misplaced .active class).
Fixes dropdown markup on items without children (reported in #517 (comment)).

Changes proposed in this Pull Request:

  • Defines 3 new boolean variables for better readability: $is_dropdown, $is_dropdown_item, $is_active. They indicate whether a menu item is a dropdown, a dropdown item and whether the menu item is active.
  • Removes the .active class from the li-element and add it to the a-element if the item is a dropdown item. (https://getbootstrap.com/docs/4.6/components/dropdowns/#active)
  • Removes the dropdown markup if a menu item has children but display is restricted by $args-depth.

Proposed changelog entry for your changes:

Fix misplaced .active class
Remove dropdown markup on items without visible children

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add active class to dropdown menu items for current page
1 participant