-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed Stacklayout is not rendered when clip is applied and StackLayout placed child to the Border control in iOS/ Mac platform #33330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kubaflo
merged 14 commits into
dotnet:inflight/current
from
KarthikRajaKalaimani:fix-33241
Apr 10, 2026
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
66eb3fa
Fixed StackLayout fails to render content while applying Clip, and th…
KarthikRajaKalaimani 23a8b43
Modified the fix
KarthikRajaKalaimani 1adbfec
Included test case
KarthikRajaKalaimani fd8048b
Snapshot included for mac and android platform
KarthikRajaKalaimani 6a7738b
Fixed StackLayout fails to render content while applying Clip, and th…
KarthikRajaKalaimani 481e807
Modified the fix
KarthikRajaKalaimani 129a3fe
Included test case
KarthikRajaKalaimani 41a1ada
Snapshot included for mac and android platform
KarthikRajaKalaimani f350bef
Merge branch 'fix-33241' of https://github.com/KarthikRajaKalaimani/m…
KarthikRajaKalaimani baa2755
Modified the fix and testcase name
KarthikRajaKalaimani eb1151c
renamed the snapshot name as based on the test case name
KarthikRajaKalaimani c43732b
Snapshot added for windows and iPhone 26
KarthikRajaKalaimani 8fb9629
removed mac snapshot
KarthikRajaKalaimani 9497d6a
added comments
KarthikRajaKalaimani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+9.36 KB
...pshots/android/ClippedStackLayoutInsideBorderWithBackgroundRendersCorrectly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,38 @@ | ||
| using Microsoft.Maui.Controls.Shapes; | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 33241, "StackLayout fails to render content while applying Clip, and the layout is placed inside a Border with Background", PlatformAffected.iOS | PlatformAffected.macOS)] | ||
| public class Issue33241 : ContentPage | ||
| { | ||
| public Issue33241() | ||
| { | ||
| var layout = new VerticalStackLayout(); | ||
| var label = new Label(); | ||
| label.Text = "The blue box should have a red box inside of it."; | ||
| label.AutomationId = "Label"; | ||
| layout.Children.Add(label); | ||
| var border = new Border | ||
| { | ||
| HeightRequest = 500, | ||
| Background = Colors.SkyBlue, | ||
| Padding = 10, | ||
| Content = | ||
| new Issue33241_CustomView | ||
| { | ||
| Background = Colors.Red, | ||
| Padding = 10 | ||
| } | ||
| }; | ||
| layout.Children.Add(border); | ||
| Content = layout; | ||
| } | ||
| } | ||
|
|
||
| public class Issue33241_CustomView : StackLayout | ||
| { | ||
| protected override void OnSizeAllocated(double width, double height) | ||
| { | ||
| this.Clip = new RoundRectangleGeometry { Rect = new Rect(0, 0, width, height) }; | ||
| base.OnSizeAllocated(width, height); | ||
| } | ||
| } |
22 changes: 22 additions & 0 deletions
22
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33241.cs
This file contains hidden or 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,22 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue33241 : _IssuesUITest | ||
| { | ||
| public Issue33241(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "StackLayout fails to render content while applying Clip, and the layout is placed inside a Border with Background"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Border)] | ||
| public void ClippedStackLayoutInsideBorderWithBackgroundRendersCorrectly() | ||
| { | ||
| App.WaitForElement("Label"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } | ||
Binary file added
BIN
+21.3 KB
...pshots/windows/ClippedStackLayoutInsideBorderWithBackgroundRendersCorrectly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12 KB
...apshots/ios-26/ClippedStackLayoutInsideBorderWithBackgroundRendersCorrectly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
.../snapshots/ios/ClippedStackLayoutInsideBorderWithBackgroundRendersCorrectly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.