Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,6 @@ git commit -m "Fix: Description of the change"
- `.github/instructions/android.instructions.md` - Android handler implementation
- `.github/instructions/xaml-unittests.instructions.md` - XAML unit test guidelines

### Opening PRs

All PRs are required to have this at the top of the description:

```
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you!
```

Always put that at the top, without the block quotes. Without it, users will NOT be able to try the PR and your work will have been in vain!



## Custom Agents and Skills

Expand Down
15 changes: 2 additions & 13 deletions .github/skills/pr-finalize/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,10 @@ Examples:
## Description Requirements

PR description should:
1. Start with the required NOTE block (so users can test PR artifacts)
2. Include the base sections from `.github/PULL_REQUEST_TEMPLATE.md` ("Description of Change" and "Issues Fixed"). The skill adds additional structured fields (Root cause, Fix, Key insight, etc.) as recommended enhancements for better agent context.
3. Match the actual implementation
1. Include the base sections from `.github/PULL_REQUEST_TEMPLATE.md` ("Description of Change" and "Issues Fixed"). The skill adds additional structured fields (Root cause, Fix, Key insight, etc.) as recommended enhancements for better agent context.
2. Match the actual implementation

```markdown
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you!

### Description of Change
[Must match actual implementation]

Expand Down Expand Up @@ -229,11 +223,6 @@ Example: "Before: Safe area applied by default (opt-out). After: Only views impl
Use structured template only when existing description is inadequate:

```markdown
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you!

### Root Cause

[Why the bug occurred - be specific about the code path]
Expand Down
4 changes: 0 additions & 4 deletions .github/skills/pr-finalize/references/complete-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ This example shows a PR description optimized for future agent success.

## Description
```markdown
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you!

### Root Cause

In `MauiView.GetAdjustedSafeAreaInsets()` on iOS, views that don't implement `ISafeAreaView` or `ISafeAreaView2` (such as `ContentPresenter`, `Border`) were falling through to return `baseSafeArea`. This applied full device safe area insets to views that never opted into safe area handling, causing double-padding when used inside ControlTemplates.
Expand Down
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/Issue20922.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace Maui.Controls.Sample.Issues
{
[Issue(IssueTracker.Github, 20922, "Shadow Doesn't Work on Grid in scroll view on Android", PlatformAffected.Android)]
public class Issue20922 : ContentPage
{
public Issue20922()
{
var scrollView = new ScrollView();

var grid = new Grid
{
HeightRequest = 200,
WidthRequest = 200,
AutomationId = "Grid",
BackgroundColor = Colors.Red
};

var shadow = new Shadow
{
Radius = 20,
Brush = new SolidColorBrush(Colors.Gray),
Offset = new Point(1, 50)
};

grid.Shadow = shadow;
scrollView.Content = grid;
Content = scrollView;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#if ANDROID || IOS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue20922 : _IssuesUITest
{
public Issue20922(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "Shadow Doesn't Work on Grid in scroll view on Android";

[Test]
[Category(UITestCategories.ScrollView)]
public void ShadowShouldWork()
{
App.WaitForElement("Grid");
VerifyScreenshot();
}
}
}
#endif
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.
12 changes: 12 additions & 0 deletions src/Core/src/Handlers/ScrollView/ScrollViewHandler.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ static void UpdateInsetView(IScrollView scrollView, IScrollViewHandler handler,

if (currentPaddingLayer is not null)
{
UpdateClipForShadow(currentPaddingLayer, handler.PlatformView, scrollView.PresentedContent);

// Only update if content has changed or is missing
if (currentPaddingLayer.ChildCount == 0 || currentPaddingLayer.GetChildAt(0) != nativeContent)
{
Expand All @@ -241,11 +243,21 @@ static void InsertInsetView(IScrollViewHandler handler, IScrollView scrollView,
Tag = InsetPanelTag
};

UpdateClipForShadow(paddingShim, handler.PlatformView, scrollView.PresentedContent);

handler.PlatformView.RemoveAllViews();
paddingShim.AddView(nativeContent);
handler.PlatformView.SetContent(paddingShim);
}

static void UpdateClipForShadow(ContentViewGroup paddingShim, MauiScrollView scrollView, IView? content)
{
bool hasShadow = content?.Shadow is not null;
paddingShim.SetClipChildren(!hasShadow);
paddingShim.SetClipToPadding(!hasShadow);
scrollView.SetClipChildren(!hasShadow);
}

Size ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint, double heightConstraint)
{
if (VirtualView is not { } scrollView)
Expand Down
Loading