Nested Elements don't render as expected

Product: PowerShell Universal
Version: 2.6.1
Framework: 3.8.0

We’ve updated our dev environment to 2.6.1 and noticed some odd behaviour with New-UDEndpoint not rendering when it did in 2.5.5.

Below is a simplified example that reproduces the issue we’re seeing.

New-UDDashboard -Title 'Title' -Content {
    New-UDElement -Tag 'div' -Endpoint {
        New-UDElement -Tag 'div' -Content {
            New-UDElement -Tag 'div' -Id 'myDiv' -Endpoint {
                Get-Date
            }
            
            New-UDButton -Text 'Click Me' -OnClick {
                Sync-UDElement -Id 'myDiv'
            }
        }
    }
}

Expected result

As it was in 2.5.5
IIS 2.5.5

Actual result

Running Locally

local 2.6.1

Running on IIS

IIS 2.6.1

I can reproduce this. I was able to work around it by including a second nested div.

New-UDDashboard -Title 'Title' -Content {
    New-UDElement -Tag 'div' -Endpoint {
        New-UDElement -Tag 'div' -Content {
            New-UDElement -Tag 'div' -Id 'myDiv' -Endpoint {
                Get-Date
            }
            
            New-UDButton -Text 'Click Me' -OnClick {
                Sync-UDElement -Id 'myDiv'
            }
        }
        New-UDElement -Tag 'div' -Endpoint {}
    }
}

This has been resolved in 2.6.2 and will be in tonight’s nightly build. We’ll likely we releasing 2.6.2 as soon as we figure out the service crash some are seeing.

2 Likes

:+1: Great, thanks Adam!