dotnet / dotnet/maui

ContentView does not respect IsClippedToBounds (does not clip children)

Open
#8,050 5 comments 0 reactions 0 assignees View on GitHub
area-layout platform/android s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

As shown in the repro sample, the translated pink grid is not clipped by the ContentView.

This report replaces the one wrongly closed by @Redth : https://github.com/dotnet/maui/issues/6656#issue-1220435024

### Steps to Reproduce

1. Build the repro sample and run under Android 11
2. The ContentView left edge is bown and the pink content should be clipped by it, but it extends to the left of the ContentView.

Replacing the ContentView with something like Grid causes things to work normally.

[layoutbug7.zip](https://github.com/dotnet/maui/files/8909173/layoutbug7.zip)

![image](https://user-images.githubusercontent.com/6193288/173825539-d4546123-03dc-4b27-82d1-22e71897ef6d.png)

### Version with bug

6.0.400 (current)

### Last version that worked well

Unknown/Other

### Affected platforms

Android, I was *not* able test on other platforms

### Affected platform versions

Android 11

### Did you find any workaround?

none

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by building the attached layoutbug7.zip repro and running it on Android 11. Inspect the ContentView clipping behavior and compare it with Grid, which the report says clips correctly. Done means the translated pink children remain within the ContentView's left edge.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp
Domain
frontend, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.