diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index 4035a8b08..b7b1bbf88 100644 Binary files a/netbox/project-static/dist/netbox.js and b/netbox/project-static/dist/netbox.js differ diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index 9ecd69de0..c00343ab3 100644 Binary files a/netbox/project-static/dist/netbox.js.map and b/netbox/project-static/dist/netbox.js.map differ diff --git a/netbox/project-static/src/sidenav.ts b/netbox/project-static/src/sidenav.ts index 4dabc27b1..cf2347980 100644 --- a/netbox/project-static/src/sidenav.ts +++ b/netbox/project-static/src/sidenav.ts @@ -209,17 +209,19 @@ class SideNav { const dropdownMenu = link.closest('.dropdown-menu') as Nullable; if (isElement(dropdownMenu)) { // Find the closest `.nav-link`, which should be adjacent to the `.dropdown-menu` element. + const groupItem = dropdownMenu.parentElement; const groupLink = dropdownMenu.parentElement?.querySelector('.nav-link'); - if (isElement(groupLink)) { - groupLink.classList.add('active'); + if (isElement(groupLink) && isElement(groupItem)) { switch (action) { case 'expand': groupLink.setAttribute('aria-expanded', 'true'); + groupItem.classList.add('active'); dropdownMenu.classList.add('show'); link.classList.add('active'); break; case 'collapse': groupLink.setAttribute('aria-expanded', 'false'); + groupItem.classList.remove('active'); dropdownMenu.classList.remove('show'); link.classList.remove('active'); break;