AutoComplete initial value not in EventData form

Hello,

When the AutoCompletion component is in a form with an initial value defined by the value parameter, that value is not accessible through the EventData of the form.

See the code below:

New-UDPage -Name test -Title test -Url "/test/" -Navigation $Cache:Navigation {         
    New-UDForm -Children {
        New-UDTypography -Text '1: Don''t touch the AutoComplete and enter any character in the Textbox => No toast notification because no value in $EventData.AutoComplete' -Variant subtitle1
        New-UDTypography -Text '2: Select a value in AutoComple => Toast notification displays the good value from $EventData.AutoComplete' -Variant subtitle1
        New-UDTypography -Text '3: Enter any character in the Textbox => Toast notification displays the good value from $EventData.AutoComplete' -Variant subtitle1

        New-UDTextbox -Label 'Textbox' -Placeholder 'Enter any character to see the bug'
        New-UDAutocomplete -Id 'AutoComplete' -Label 'AutoComplete with default value' -Value 'default' -Options @('default','test1','test2','test3')
    } -OnValidate {
        Show-UDToast -Message $EventData.AutoComplete
        New-UDFormValidationResult -Valid
    } -OnSubmit {
        Show-UDToast -Message $EventData.AutoComplete
    }
}

I don’t seem to have seen this issue declared on the github. If necessary I can open it.

Product: PowerShell Universal
Version: 1.5.18

This is also a bug and feel free to open an issue.

Done. Thank you.

AutoComplete initial value not in EventData form · Issue #175 · ironmansoftware/issues (github.com)

1 Like

Thanks for the quick fix :slight_smile: