question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Grid only renders and lays out first child

See original GitHub issue

Description

I have a Grid layout set as a Content to a ScrollView. Inside the Grid I have two children - the first one is not visible (IsVisible is set to false) and the second one is visible:

<ScrollView>   
    <Grid>
        <!-- If we switch the places of the two Labels the Text of the visible one will be visualized -->
        <Label Text="I am not visible" IsVisible="False"/>
        <Label Text="I am visible"/>
    </Grid>
</ScrollView>

When I run my application nothing is visialized. If I switch the places of the Children the visible child is visualized as expected.

Steps to Reproduce

  1. Run the attached project.
  2. Navigate to the second page.
  3. Notice that nothing is visualized.

HelloMaui.zip

Version with bug

Preview 13

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 8 (at least) and up

Did you find any workaround?

No response

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mattleibowcommented, Apr 26, 2022

@hartez @PureWeen I thought someone opened this issue before - and I feel like that is why I know about it. But, I can’t seem to find it.

I am soooo sure I reviewed a PR on this exact issue that I am now doubting my memory.

If anyone knows of the issue, feel free to link to it.

Right now I am going to assume I can’t find the issue because it does not exist and will update the title to be more accurate.

0reactions
ivan-todorov-progresscommented, Apr 29, 2022

@mattleibow Perhaps the bug is somehow related to how the Grid is measured by its parent. I assume the ScrollView measures the Grid with double.PositiveInfinity, while the ContentPage - with some fixed value. This is just a wild guess though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exempt a child element from auto layout in CSS grid ...
Basically I want it to not participate in the grid layout at all - not take up a "slot" in the auto layout,...
Read more >
Basic concepts of grid layout - CSS: Cascading Style Sheets
CSS grid layout introduces a two-dimensional grid system to CSS. Grids can be used to lay out major page areas or small user...
Read more >
Grid layout using line-based placement - CSS - MDN Web Docs
Inside our grid container, we have four child elements. If we do not place these on to the grid in any way they...
Read more >
Make grid container fill columns not rows
In this case, we want 2 items to be in the first column. target the remaining items (from the third onwards) with ~...
Read more >
CSS Grid Gotchas And Stumbling Blocks
The first layout uses flexbox to display as many boxes as will fit into the available width. Here we are controlling the layout...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found