New-UDTransition default folder in

I’m know that I’m missing something but I can’t make the xxx to bee foldern in as default so the user need to click the slide to open it.
What am I doing wrong? Been working for to long now so I can’t see what’s wrong.

Set-UDElement -Id 'test' -Properties @{
    in = $EventData -eq 'true'
}
        
New-UDGrid -Item -Size 12 -Content {
    New-UDHtml -Markup "<B>Information från uSource</b>"
    New-UDTransition -Id 'test' -Content {
        New-UDCard -Text "Hey"
    } -In -Collapse -CollapseHeight 100 -Timeout 1000

    New-UDSwitch -OnChange {
        Set-UDElement -Id 'test' -Properties @{
            in = $EventData -eq 'true'
        }
    } -Checked $true
}

If the first call to Set-UDElement just in the dashboard page? If that’s the case, it might be that the $EventData value is null and causing it to transition out when the page is loading. Like what if you just do this:

New-UDGrid -Item -Size 12 -Content {
    New-UDHtml -Markup "<B>Information från uSource</b>"
    New-UDTransition -Id 'test' -Content {
        New-UDCard -Text "Hey"
    } -In -Collapse -CollapseHeight 100 -Timeout 1000

    New-UDSwitch -OnChange {
        Set-UDElement -Id 'test' -Properties @{
            in = $EventData -eq 'true'
        }
    } -Checked $true
}
1 Like

Don’t work either, The problem is that it’s open as default when you reload the page. What I want is that it should bee closed as default.

It’s inside three UD-Dynamic’s before the code that you did post if that makes any difference? All of them have other -id s then the New-UDTransition

The UD-Dynamics don’t matter I tried to past the code on a plank page and it’s the same it’s open I can’t understand how to make it show closed as default so the user need to click on the switch to open it.

@adam any ide?

I will try to figure this out. Need to play around with it a bit.

It seems to be working as expected for me. This is what you want, right?

transition

I tried it like this.

New-UDGrid -Item -Size 12 -Content {
    New-UDHtml -Markup "<B>Information från uSource</b>"
    New-UDTransition -Id 'test' -Content {
        New-UDCard -Text "Hey"
    } -Collapse -CollapseHeight 100 -Timeout 1000

    New-UDSwitch -OnChange {
        Set-UDElement -Id 'test' -Properties @{
            in = $EventData -eq 'true'
        } 
    }
}

I also tried it like this.

    New-UDDynamic -Content {
New-UDGrid -Item -Size 12 -Content {
    New-UDHtml -Markup "<B>Information från uSource</b>"
    New-UDTransition -Id 'test' -Content {
        New-UDCard -Text "Hey"
    } -Collapse -CollapseHeight 100 -Timeout 1000

    New-UDSwitch -OnChange {
        Set-UDElement -Id 'test' -Properties @{
            in = $EventData -eq 'true'
        } 
    }
}
    } 

Yeah, I had worked for to long. (Feeling stupid now)
What I did miss was to replace -text “test” with -Content {} on the card in you example.

1 Like