Button group drop down does not close after click

Button group drop down does not close after click

avatar

Button group down does not close after clicking an item, causing visual problems for me.

It only closes after clicking outside.


image-2.png



Shows UDModal, but the dropdown stays in front.


image.png


It should close after clicking one of the New-UDButtonGroupItems.

Please let me know if the issue is on my side of the configuration




function New-UDBg {
    param(
[string]$Lable,
[string]$Value,
[string]$Classname,
[string]$icon,
[string]$size = "small"


)
try {
        New-UDButtonGroup -ClassName $Classname -Variant text -FullWidth -Size $size -Content {
            New-UDButtonGroupItem -Text $Lable -Icon (New-UDIcon -Icon $icon -Size xs) -OnClick {
                Invoke-UDRedirect -Url $Value -OpenInNewWindow
}
            New-UDButtonGroupItem -Text 'Copy' -Icon (New-UDIcon -Icon "copy") -OnClick {
                Set-UDClipboard -Data $Value
}


            New-UDButtonGroupItem -Text 'Show QR-Code' -Icon (New-UDIcon -Icon "qrcode") -OnClick {
                Show-QRCodeModal -Value $Value
}
}
}
catch {
        Write-PSULog -Level Error $_
}


}


Best Regards, Dy

All Comments (1)

avatar

Hello Dy,


Thank you for the clear description, the screenshots and the code.


Your code uses New-UDButtonGroup and New-UDButtonGroupItem as documented, and what you see matches a known issue in the button group itself. In PowerShell Universal 5.6.8 and 2026.3.4, the versions we checked, clicking an item in the drop-down of a button group runs the item's OnClick, but the drop-down only closes when you click outside of it. Your screenshot shows the same with the modal that Show QR-Code opens, where the drop-down stays open in front of it.


Our development team already has this issue on record. There is no fix for it yet. I am passing your case on to them, and I will let you know as soon as a version that fixes it is available.


Kind regards,

Michel Audi