Skip to content
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

Not All Containers have IgnoreSafeArea Property #16360

Open
borrmann opened this issue Jul 26, 2023 · 10 comments
Open

Not All Containers have IgnoreSafeArea Property #16360

borrmann opened this issue Jul 26, 2023 · 10 comments
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@borrmann
Copy link
Contributor

Description

e.g. ScrollView doesnt have IgnoreSafeArea. Since IgnoreSafeArea is set to False per default. a Grid has a padding per default, while a ScrollView doesnt. This causes Layout bugs on iOS per default, when UseSafeArea is set to False on Page level.

Steps to Reproduce

  1. Create a ContentPage with UseSafeArea=False
  2. Add Page with a Grid
  3. Add Another Page with a ScrollView
  4. Content of the 2 pages is not in the same area

Link to public reproduction project repository

Version with bug

7.0.49

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

any iOS

Did you find any workaround?

Wrap Containers that arent a Layout with a Layout like Grid.

Relevant log output

No response

@borrmann borrmann added the t/bug Something isn't working label Jul 26, 2023
@borrmann
Copy link
Contributor Author

@hartez

@jsuarezruiz jsuarezruiz added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/iOS 🍎 labels Jul 26, 2023
@borrmann
Copy link
Contributor Author

borrmann commented Jul 27, 2023

Interestingly a ScrollView that is inside a Grid with IgnoreSafeArea=False, sometimes also extends to the full screen, but sometimes doesn't... Unfortunately I am not able to figure out when exactly this happens and when not. It seems like a race condition because after navigating from and back to the same page the behavior changes sometimes

@ewerspej
Copy link

ewerspej commented Aug 1, 2023

Isn't the Safe Area a feature for Pages? Why would any child views need such a setting?

@borrmann
Copy link
Contributor Author

borrmann commented Aug 1, 2023

@ewerspej I read IgnoreSafeArea was introduced because Comet doesn't have Pages. But I agree, they shouldn't really have this property, or if they do at least it should be implemented on all Layouts and the default should be the other way around. Also I really don't understand why such a breaking change was introduced for Comet, which according to the github repo is only 'proof of concept'.

@Geethu-AdhikarVeedu
Copy link

Interestingly a ScrollView that is inside a Grid with IgnoreSafeArea=False, sometimes also extends to the full screen, but sometimes doesn't... Unfortunately I am not able to figure out when exactly this happens and when not. It seems like a race condition because after navigating from and back to the same page the behavior changes sometimes

I just got to see the exact same issue. The scroll inside grid doesn't expand when list items are less, when i added more items which doesn't fit in the screen, the scroll started expanding as expected. :/

@jaosnz-rep jaosnz-rep added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Feb 19, 2024
@jaosnz-rep
Copy link

Verified this issue with Visual Studio Enterprise 17.10.0 Preview 1. Can repro on iOS platform with repro steps.

@jsuarezruiz jsuarezruiz added the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Jun 7, 2024
@borrmann
Copy link
Contributor Author

borrmann commented Jun 7, 2024

What does latest-version mean? .NET 9?

@dotnet-policy-service dotnet-policy-service bot removed the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Jun 7, 2024
@jsuarezruiz
Copy link
Contributor

What does latest-version mean? .NET 9?

Latest .NET 8 version, .NET 8.0.6

@borrmann
Copy link
Contributor Author

@jsuarezruiz thank you. The default behaviour now seems improved. When using a ScrollView, content is still not displayed in the Danger Zone though, even when all Layouts have IgnoreSafeArea="True" and the page has ios:Page.UseSafeArea="False"
It appears, any Content inside a ScrollView now has a Margin. This happens, even when all the children of the ScrollView have the property IgnoreSafeArea="True".

This means that this:

<Grid IgnoreSafeArea="True" BackgroundColor="Pink">

       <ScrollView BackgroundColor="Green"
                   Padding="0"
                   Margin="0,10,0,0">

           <VerticalStackLayout BackgroundColor="Blue"
                                IgnoreSafeArea="True"
                                Margin="0"
                                Padding="30,0"
                                Spacing="25">

shows a Green backgroud on the page in the danger zone, eventhough VerticalStackLayout has no margin and ScrollView has no padding.

Here is a repo

@borrmann
Copy link
Contributor Author

The use case is very simple and basic. -> Wanting to have the whole page available for content, no matter the layout (or View) that is used.

@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants