Skip to content
Merged
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue28153.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace Controls.TestCases.HostApp.Issues;

[Issue(IssueTracker.Github, 28153, "The border color of the RadioButton is visible in Windows only", PlatformAffected.UWP)]
class Issue28153 : ContentPage
{
public Issue28153()
{
VerticalStackLayout verticalStackLayout = new VerticalStackLayout();

RadioButton radioButtonWithoutBorder = new RadioButton
{
AutomationId = "RadioButtonWithoutBorder",
Content = "RadioButton",
BorderColor = Colors.Red
};

RadioButton radioButtonWithBorder = new RadioButton
{
AutomationId = "RadioButtonWithBorder",
Content = "RadioButton",
BorderColor = Colors.Red,
BorderWidth = 3
};

verticalStackLayout.Children.Add(radioButtonWithoutBorder);
verticalStackLayout.Children.Add(radioButtonWithBorder);

Content = verticalStackLayout;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

internal class Issue28153 : _IssuesUITest
{
public Issue28153(TestDevice device) : base(device) { }

public override string Issue => "The border color of the RadioButton is visible in Windows only";

[Test]
[Category(UITestCategories.RadioButton)]
public void ValidateRadioButtonNoBorderColorWhenNoBorderWidth()
{
App.WaitForElement("RadioButtonWithoutBorder");
VerifyScreenshot();
}
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/Core/src/Platform/Windows/RadioButtonExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ static void UpdateColors(ResourceDictionary resource, string[] keys, WBrush? bru

public static void UpdateStrokeThickness(this RadioButton nativeRadioButton, IRadioButton radioButton)
{
nativeRadioButton.BorderThickness = radioButton.StrokeThickness <= 0 ? WinUIHelpers.CreateThickness(3) : WinUIHelpers.CreateThickness(radioButton.StrokeThickness);
// Ensure stroke thickness is non-negative; a negative value causes an exception, so it defaults to zero if unset or invalid.
nativeRadioButton.BorderThickness = radioButton.StrokeThickness < 0 ? WinUIHelpers.CreateThickness(0) : WinUIHelpers.CreateThickness(radioButton.StrokeThickness);
}

public static void UpdateCornerRadius(this RadioButton nativeRadioButton, IRadioButton radioButton)
Expand Down
Loading