Not getting the New-UdCollapsible to work

Hi,

I am trying to get the New-UdCollapsible to work, but I am only receiving the title.
The content that should be visible when clicked, does not show up.

I did a simple page just copying the content from the example, but still, nothing shows up when I click the collapsible item.

Anyone else experience this? UD version is 2.4.1

$CollapsiblePage = New-UDPage -Name “Collapsible1” -Title “Collapsible1” -Content {
New-UDCollapsible -Items {
New-UDCollapsibleItem -Title “Item 1” -Icon arrow_circle_right -Content {
“Some content”
}
}
}

Regards
Tore

its working fine with no issues

$CollapsiblePage = New-UDPage -Name “Collapsible1” -Title “Collapsible1” -Content {
New-UDCollapsible -Items {
New-UDCollapsibleItem -Title “Item 1” -Icon arrow_circle_right -Content {
New-UDButton -Text "button" -Icon atom -OnClick {}
}
}
}
Start-UDDashboard -Content{  
New-UDDashboard -Pages @($CollapsiblePage) -Title "test"
} -Port 1000 -Name Test

Really strange, I have run the same test on 3 different machines here, and same result on all…
I have tried IE, Chrome, Edge just to see if it was the browser but same in all…

But thanks for confirming that it works :wink:

Anyone else having issues with this? Still does not work for me, tested on several machines, and same issue on all… UD Community version 2.5.2 is the one I am using.

Tried it on a fresh installed machine as well, same issue here.

You can’t only put text inside it.
The content / endpoint of New-UDCollapsibleItem expect other components, not just a string.

You can refer to the help for that cmdlet for more details
Get-Help New-UDCollapsibleItem -Detailed

-Content
Content of this collapsible. Other components can be nested within this item.
.
-Endpoint
The endpoint that returns the content for this component.

Either put an UD-Card or you could simply juste use a UDElement to define a paragraph, such as my example below.

 New-UDCollapsible -Items {
        New-UDCollapsibleItem -Title "Item 1" -Icon arrow_circle_right -Content {
         New-UDElement -Tag 'P' -Content {'Some content'}
        }
    }
1 Like

Aha, Thank you, I’ll try this, but this must have been a change in the way it works that I didn’t catch, because my code used to work as it is now… I’ll let you know if things starts working again :wink:

Note: Bingo, it works now :wink: Thank you!