Adminlte: Sidebar menu tree dropdown always open

Created on 7 Apr 2018  路  2Comments  路  Source: ColorlibHQ/AdminLTE

Issue type:

  • [ ] Feature request
  • [x] Bug report
  • [ ] Documentation

Environment:

  • AdminLTE Version: v2.4.0
  • Operating System: Windows 10
  • Browser (Version): Chrome ( 65.0.3325.181 - Latest), Firefox (59.0.2 - Latest)

Description:

You can reproduce the bug here https://adminlte.io/themes/AdminLTE/pages/examples/profile.html with one of the browser versions that I use, the sidebar dropdown will only stay opened as you can see in this video https://i.gyazo.com/9858b6a02c35372275a1da6478d3aeba.mp4

js bug 2.4.x

All 2 comments

Hi,
I figured out how to fix it... kinda.
It works, but it might not be the best thing to do.
Anyway, here is how I fixed it:
In adminlte.js, add
$(tree).css('cssText', 'display: none !important;');
after line 1081
and
else { $(data['element']).children('.treeview:not(.menu-open)').children('.treeview-menu').css('cssText','display: none !important'); }
at line 1106.
See this pastebin to see what it should look like.

Explanation:
The thing is that whenever you close the dropdown, the jQuery slideUp animation start, so it slides up, and then the CSS takes over by applying 'display: block' that does not hide the dropdown content.
I needed to override this 'display: block' but I haven't figured out how to do it in CSS, because the only thing I was able to do was selecting all dropdown without .menu-open class but.. it removes the animation.
So I searched through the adminlte.js and figured out this.

Hope it will help some people.

EDIT: Added short explanation.

hi i made a pr to solve(ish) it
https://github.com/almasaeed2010/AdminLTE/pull/2001

Was this page helpful?
0 / 5 - 0 ratings