fix(WEB-BUG-011): fix sidebar Organizations menu not expanding#70
Merged
Conversation
Two bugs prevented the dropdown menu from opening: 1. `menu.menus === null` condition in generateMenuHTML() was always false because convertToMenuTree() initializes every node with `menus: []`. Changed to `!menu.menus || menu.menus.length === 0` so leaf items render as plain nav links, not dropdown toggles. 2. `data-bs-toggle="dropdown"` on the dropdown-toggle div caused Bootstrap's built-in handler and the custom click handler to both toggle the `show` class, netting to no change (open then close). Removed the Bootstrap attribute; the custom handler already manages show/hide manually via nextElementSibling.
fix(WEB-BUG-011): fix sidebar Organizations menu not expanding
MZC-CSC
added a commit
that referenced
this pull request
May 11, 2026
fix(WEB-BUG-011): fix sidebar Organizations menu not expanding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix two bugs that prevented the Organizations sidebar menu from expanding when clicked.
menu.menus === nullnull check ingenerateMenuHTML()(sidebar.js)data-bs-toggle="dropdown"attribute that caused Bootstrap and custom handlers to conflictRoot Cause
Bug 1 — Wrong null check
convertToMenuTree()initializes every menu node withmenus: [](empty array), so the conditionmenu.menus === nullwas alwaysfalse. Leaf menu items (with no children) were incorrectly rendered as dropdown toggles instead of plain nav links.Bug 2 — Bootstrap double-toggle
The dropdown-toggle
<div>haddata-bs-toggle="dropdown", which made Bootstrap's built-in click handler fire alongside the customnextElementSiblingtoggle handler. Both handlers toggled theshowclass, resulting in the menu opening and immediately closing (net: no visible change).Changes
front/assets/js/partials/layout/sidebar.jsmenu.menus === null→!menu.menus || menu.menus.length === 0data-bs-toggle="dropdown" data-bs-auto-close="false"from generated dropdown HTMLVerification
<a>nav linksIssue Reference