Skip to content

Conversation

dfsmania
Copy link
Contributor

@dfsmania dfsmania commented Aug 1, 2025

Fix: Prevent incorrect menu-open behavior on sidebar items without children

Currently, the menu-open class is added or removed on all .nav-item elements in the sidebar, regardless of whether they contain a submenu. This leads to an unintended UX issue: clicking multiple links with href="#" causes multiple items to appear as active/open, even if they don’t have a child menu. This creates the misleading impression that several unrelated items are "open" at once.

For example, in the screenshot below (taken from the AdminLTE demo), clicking on items like Important, Warning, etc., triggers this issue:

Screenshot 2025-08-01 at 18-35-58 AdminLTE Dashboard v2

What's changed

This PR updates the behavior to ensure that the menu-open class is only toggled on .nav-item elements that contain a child .nav-treeview menu. The proposed fix avoids creating Treeview instances on elements that does not have a submenu (like a link element).

Copy link

netlify bot commented Aug 1, 2025

Deploy Preview for adminlte-v4 ready!

Name Link
🔨 Latest commit 7e51eb0
🔍 Latest deploy log https://app.netlify.com/projects/adminlte-v4/deploys/688d4676e95f9700089c7b91
😎 Deploy Preview https://deploy-preview-5888--adminlte-v4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dfsmania dfsmania marked this pull request as draft August 1, 2025 22:24
@dfsmania dfsmania marked this pull request as ready for review August 1, 2025 23:01
@dfsmania
Copy link
Contributor Author

dfsmania commented Aug 2, 2025

@puikinsh @danny007in Please, review this fix when you get some time...

@danny007in danny007in self-requested a review August 4, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant