dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

[MAUI] Can't clear RadioButton Selection #25780

Closed William-H-M closed 1 week ago

William-H-M commented 1 week ago

Description

RadioButtonGroup.SelectedValue can't be cleared using the binding property

Steps to Reproduce

  1. Create a maui base project
  2. Add a radio button which respond to property changes as stated in docs https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/radiobutton?view=net-maui-8.0#respond-to-a-property-change
  3. Select any item
  4. Clear the property of RadioButtonGroup.SelectedValue with either null or string.Empty

Expected: Clear of selected and no radio button checked Actual: Selection property cleared but radio button still checked https://github.com/user-attachments/assets/d4c00445-9a5c-48f6-a692-7742cba14671

Link to public reproduction project repository

https://github.com/William-H-M/RadioButtonBug

Version with bug

8.0.93 SR9.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

You can work around this if a RadioButton with value of "" is set with Visible=Hidden like:

<RadioButton
    Content=""
    IsVisible="Hidden"
    Value="" />

Relevant log output

similar-issues-ai[bot] commented 1 week ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

Zhanglirong-Winnie commented 1 week ago

This issue has been verified using Visual Studio 17.12 Preview 5(8.0.93 & 8.0.3 & 9.0.0-rc.2.24503.2). Can repro this issue on android and iOS platforms.

mattleibow commented 1 week ago

Duplicate of https://github.com/dotnet/maui/issues/19437

mattleibow commented 1 week ago

Closing this and updated the other issue to mention all platforms