Udautocomplete options search is a bit fuzzy


I have noticed when the autocomplete has a lot of options, the first time you click the input field the search doesn’t really work properly and i get suggestions which do not match what im typing. Also whatever i type does not show up in the input field.

I have solved this by adding a dummy option (“1”), which you can delete before you start typing and then it works 100%.

Sample of my code:

$serverlist = (invoke-restmethod https://s0apun0001g.cbsp.nl/api/Devices).Hostname

            New-UDAutocomplete -Label "Servers to Snapshot" -Multiple -OnLoadOptions {

            $serverlist | Where-Object { $_ -like "*$Body*" }  | ConvertTo-Json

Is there a way to do this better/ differently so it works immediately?
The resulting set is about 1100 devices.

Product: PowerShell Universal
Version: 2.5.5

I think this is just simply a constraint of how long it takes to iterate on that where operator through the pipeline, the more items you have in your array the slower it will get, unfortunatly powershell isnt the quickest language for things like this. Maybe someone else has a better idea?

Could be, it works fine if i have only a few items, sadly.