question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sidebar menu treeview not open when .active

See original GitHub issue

Hello,

First, thank you for your work, it’s great. But (yes, there is a “but”), I’ve got a problem with the left sidebar (treeview).

With this markup, the ul.treeview-menu is not displayed and I think it should be.

<ul class="sidebar-menu">
    <li class="treeview active">
        <a href="#">
            <i class="fa fa-users"></i>
            <span>Users</span>
            <i class="fa fa-angle-left pull-right"></i>
        </a>
        <ul class="treeview-menu">
            <li class="active">
                <a href="##">
                    Permissions
                </a>
            </li>
            <li>
                <a href="##">
                    Other submenu
                </a>
            </li>
        </ul>
    </li>
</ul>

Result image

Expected image

To “solve” this, I added this CSS rule in my stylesheet, but I don’t know if it’s really good :

.sidebar .sidebar-menu .active .treeview-menu {
    display: block;
}

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
schcarlos1873commented, Dec 20, 2018

In react after login, I had problem with resize and treeview. I solved the problem using jquery on componentDidMount() method.

export default class App extends React.Component { componentDidMount () { jquery(‘body’).layout(‘fix’); jquery(‘body’).layout(‘fixSidebar’); jquery(document).ready(() => { const trees = jquery(‘[data-widget=“tree”]’); trees.tree(); }); } render() { return ( … ); } }

1reaction
zubaer-ahammedcommented, Apr 30, 2017

I have found it works when I enter full URL instead of relative URL. Example: Instead of using <a href="/food">Food</a> I used <a href="http://zubaer.com/food">Food</a> And it works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sidebar menu treeview not opening when active through ...
I am having some problem while activating the side menu tree in my page. My JQuery code is: $(document).ready(function () { alert("hi"); ...
Read more >
AdminLTE 3 expend menu doesn't close/collapsed when ...
Right now all menu items are opening one by one and they can only be closed by clicking on the item again. any...
Read more >
Main Sidebar Component | AdminLTE 3 Documentation
Additional Classes. Sidebar .sidebar-no-expand Disables Auto Expand on Hover/Focus. Navbar .nav ...
Read more >
Ability to set active class/property to a selected menu ... - Drupal
I have my sidebar menu setup with menu and submenu items. What I want that whenever someone clicks on a menu item, it...
Read more >
adminlte sidebar menu active not working
This issue has been solved in AdminLTE 2.0. The app.js version you are using @Adysone contains the issue since it is responsible of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found