New-UDAutocomplete $body trim question

Product: PowerShell Universal
Version: 4.2.13

Simple question
I use New-UDAutocomplete to choose user from list (ad user list)
here is sample code:

New-UDAutocomplete -Id 'User' -Label "User" -Icon (New-UDIcon -Icon 'AddressBook' -Solid -Color $icon_color) -FullWidth -OnLoadOptions {
                    if ($body.length -ge 3)
                         ($cache:ad_users) | Where-Object { $_ -like "*$Body*" } | Sort-Object $_ | ConvertTo-Json

and it is working flawlessly when user is typing name or surname of user.

but sometimes (i guess most of the time) users are copying name from other sources and it sometimes contains leading or ending spaces.

I tried to add

$Body = $body.trim()

to the code, but it does nothing. even when I type name with leading space it does not show any names to choose.

What im doing wrong ? how to handle such situation ?