-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix SafeArea adjustments #27043
base: main
Are you sure you want to change the base?
Fix SafeArea adjustments #27043
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
Files not reviewed (1)
- src/Controls/tests/TestCases.HostApp/Issues/Issue24246.xaml: Language not supported
Comments suppressed due to low confidence (2)
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24246.cs:15
- The test case should verify that the layout adjusts correctly for the safe area insets. Add a test to check the visual layout to confirm that the safe area insets are applied correctly.
[Test]
src/Core/src/Platform/iOS/MauiView.cs:123
- Ensure that the new behavior for adjusting safe area insets in SizeThatFits is covered by tests.
if (RespondsToSafeArea() && widthConstraint >= 0 && heightConstraint >= 0)
/rebase |
c86e5fb
to
3e9b5e7
Compare
/rebase |
3e9b5e7
to
1a70a08
Compare
/rebase |
1a70a08
to
07f4662
Compare
/rebase |
07f4662
to
9204db8
Compare
@PureWeen I think its been retried a few times now so I think there is indeed some valid test failure |
Description of Change
We initially had to revert this PR because of a conflict with ScrollView that was uncovered #24600
We recently vastly simplified the
ScrollView
control on iOS #26763 which looks to have fixed the issue we were running up against.This PR relates to some issues found here #22476 when trying to layout a Button when it's inside a layout that is partly inside the safearea.
The problem we found is that the
MauiView
returns a size fromSizeThatFits
that doesn't include theSafeAreaInsets
. The arrange pass insets itsBounds
and passes this value toCrossPlatformArrange
but theBounds
being used is the size of the children not including theSafeAreaInsets
which means the bounds used for arranging is wrong.You can see from the screenshots below that the
VSL
surrounding the the entry gets arranged incorrectlyComparison
Given the following
XAML
Issues Fixed
Fixes #24246