Kuprich/BlazorProSidebar

Child Items do not render

Closed this issue · 1 comments

Changed the following to allow child items to render in SidebarComponent.razor

private void MenuItemClick(MenuItem menuItem)
  {
      if (!menuItem.IsActive)
      {
          if (!menuItem.HasChildMenuItems)
          _navigationManager.NavigateTo(menuItem.Href);
      }
      
      if (menuItem.IsActive)
      {
          if (menuItem.HasChildMenuItems)
              menuItem.IsOpened = !menuItem.IsOpened;
      
              else if (_isCollapsed)
              generalMenuItems.ForEach(x => x.IsOpened = false);

          if (!menuItem.HasChildMenuItems)
              _navigationManager.NavigateTo(menuItem.Href);
           
           return;
      }
      generalMenuItems.ForEach(x => x.IsOpened = false);
      menuItem.IsOpened = true;

      if (!menuItem.HasChildMenuItems && menuItem.Href != null)
      {
         
      }
  }

Closing changes made.