Product: PowerShell Universal
Version: 3.7.14
I am trying to get the entered value from a New-UDAutocomplete element, but the Get-UDElement function always returns nothing.
I am using the example function from the documentation:
New-UDAutocomplete -Options @("Test", "No", "Yes") -onEnter {
Write-Host ((Get-UDElement -Id 'ac').value)
} -Id 'ac'
adam
2
I can reproduce this issue with OnEnter. Do you need to get the value in OnEnter?
I ask because this works for me.
New-UDAutocomplete -Options @("Test", "No", "Yes") -onEnter {
} -Id 'ac'
New-UDButton -Text 'Click' -OnClick {
Show-UDToast ((Get-UDElement -Id 'ac').value)
}
It would be nice, but I can build a workaround with a button.
Tank you!