Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Navigation Groups/Items Cause Discolored (unusable) Menu #1416

Closed
rbleattler opened this issue Jan 3, 2020 · 0 comments
Closed

Nested Navigation Groups/Items Cause Discolored (unusable) Menu #1416

rbleattler opened this issue Jan 3, 2020 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@rbleattler
Copy link
Contributor

Describe the Issue

When creating a navigation menu, if a parent contains children, which contain children, upon expanding the top level parent, the next level children will be mis-colored. In most themes this will cause the menu to be un-readable/un-usable

To Reproduce

Steps to reproduce the behavior: (Example)

  1. Create Dashboard with nested expandable navigation items in the navigation bar
  2. Click on the Hamburger
  3. Click on a parent navigation item
  4. Children are (using DarkDefault or Default Themes, others unverified) White with White text. (Children of Children, however, match existing theme).

Expected behavior

The children should match the style of the rest of the navigation menu.

Screenshots

UDDashboard_issue

Script Sample

Apologies if this is over the top, or not helpful:

$Collection = @(
  @{
    Name = 'Item1'
    Properties = @{
      Property1 = 'Property1 Value1'
      Property2 = 'Property2 Value'
    }
  }
  @{
    Name = 'Item2'
    Properties = @{
      Property1 = 'Property1 Value2'
      Property2 = 'Property2 Value'
    }
  }
  @{
    Name = 'Item3'
    Properties = @{
      Property1 = 'Property1 Value3'
      Property2 = 'Property2 Value'
    }
  }
  @{
    Name = 'Item4'
    Properties = @{
      Property1 = 'Property1 Value4'
      Property2 = 'Property2 Value'
    }
  }
)

$Items = $Collection.Name

$SideNav = New-UDSideNav -Width 400 -Content {
  New-UDSideNavItem -Text 'Items' -Icon folder_plus -Children {
    $Collection | ForEach-Object {
      New-UDSideNavItem -Text $_.Name -Icon folder -Children {
        $Item = $_
        $Collection.Where{ $Item.Name -eq $_.Name }.Properties.keys.ForEach{
          New-UDSideNavItem -PageName $_ -Icon file_code
        }
      }
    }
}

$TestDashboard = New-UDDashboard -Title Test -Content {} -Navigation $SideNav

Stop-UDDashboard -Port 10003
Start-UDDashboard -Dashboard $TestDashboard -Port 10003

Workaround

I was able to get this to work by editing the active CSS in the theme before starting the dashboard as shown below. Doing This is obviously not a fix, and I believe I may have a solution, but I need to verify before I present it.

$Theme = Get-UDTheme | Where-Object { $_.Name -eq 'DarkDefault' }
$Theme.Definition += @{
  ".sidenav .collapsible-body" = @{'background-color' = $Theme.Definition[".sidenav"].'background-color'}
}
...
Start-UDDashboard ...

Version Information

  • Operating System: Windows 10, Windows Server 2012, Windows Server 2012 R2
  • PowerShell Version: 5.1, 7.0Rc1
  • Universal Dashboard Version: Latest
  • UD Hosting Method: Running in PowerShell (Powershell, IIS, App Service, Etc.)

Additional context

Add any other context about the problem here.

@rbleattler rbleattler added the bug Something isn't working label Jan 3, 2020
rbleattler pushed a commit to rbleattler/universal-dashboard that referenced this issue Jan 3, 2020
adamdriscoll pushed a commit that referenced this issue Jan 4, 2020
@adamdriscoll adamdriscoll added this to the 2.8.2 milestone Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants