-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Windows] Fix for setting IsClippedToBounds="True" inside a Border co…
…ntrol will crash on Windows (#25506) * Fixed 18937 * Modified test sample. * Updated the fix. * Simplified the test case. * Removed platform condition. * Changed return type. * ContentPanel changes. * Revert unwanted changes
- Loading branch information
1 parent
397b3ff
commit a1cd4bc
Showing
5 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/Controls/tests/TestCases.HostApp/Issues/Issue18937.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue18937"> | ||
|
||
<Border> | ||
<StackLayout BackgroundColor="red" | ||
IsClippedToBounds="True"> | ||
<Label AutomationId="Label" | ||
Text="Label Inside the Border" | ||
VerticalOptions="Center" | ||
HorizontalOptions="Center"/> | ||
</StackLayout> | ||
</Border> | ||
|
||
</ContentPage> |
12 changes: 12 additions & 0 deletions
12
src/Controls/tests/TestCases.HostApp/Issues/Issue18937.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
|
||
[Issue(IssueTracker.Github, 18937, "[Windows] Setting IsClippedToBound is true inside a Border control will crash on Windows", PlatformAffected.UWP)] | ||
public partial class Issue18937 : ContentPage | ||
{ | ||
public Issue18937() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18937.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
{ | ||
public class Issue18937 : _IssuesUITest | ||
{ | ||
public Issue18937(TestDevice device) : base(device) { } | ||
|
||
public override string Issue => "[Windows] Setting IsClippedToBound is true inside a Border control will crash on Windows"; | ||
|
||
[Test] | ||
[Category(UITestCategories.Border)] | ||
public void ExceptionShouldNotOccurWhenIsClippedToBoundsIsTrue() | ||
{ | ||
var testLabel = App.WaitForElement("Label"); | ||
Assert.That(testLabel.GetText(), Is.EqualTo("Label Inside the Border")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters