New-UDAutocomplete -Multiple allows selecting same item more than once
New-UDAutocomplete components with the -Multiple parameter allow individual options to be selected more than once. I previously opened an issue, with examples to reproduce the bug, here:
https://github.com/ironmansoftware/powershell-universal/issues/5241
That was for version 5.6.7, but the bug still exists in 2026.2.3.
Can this be fixed? Otherwise, is there a workaround?
Hello dg-td,
Thank you for reporting this and for linking the previous reproduction examples.
We will validate this behavior in PowerShell Universal 2026.2.3 using the examples from the existing issue. In particular, we want to confirm whether the duplicate selection is limited to the displayed chips or whether duplicate values are also returned through -OnChange, Get-UDElement, or form submission.
Could you please confirm whether the original examples reproduce without modification in 2026.2.3, and whether your current implementation uses static -Options or dynamic -OnLoadOptions?
At this point, we have not confirmed a supported workaround. Once the current behavior has been reproduced and its effect on the component value has been verified, we can determine whether a safe temporary mitigation is available and whether Development review is required.
Best regards,
Ruben Tapia
Ruben: The original examples work exactly the same in 2026.2.3 as they did in 5.6.7. If you select the same menu options as the ones shown in the screenshot I included, it still looks the same with the new version of PSU.
I am using static -Options, not dynamic -OnLoadOptions.
Here is another example (simplified for this post) that I am using to allow IT staff to select Active Directory groups:
New-UDAutocomplete -Multiple -Options {
(Get-ADGroup -Server $dc -Credential $cred -LDAPFilter '(name=*)' -SearchBase $searchbase -Properties CanonicalName) | Foreach-Object {
New-UDAutocompleteOption -Name $_.CanonicalName -Value $_.Name
}
}
This allows users to choose the same items multiple times, which it should not. Other than that, it works correctly.