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.

[regression/8.0.0-preview.5.8529] Grid with a star and an empty auto column leads to an incorrect layout

See original GitHub issue

Description

When using a Grid layout with * and Auto columns and there is no content in the Auto column, the result layout is incorrect.

For example, consider the following Grid layout:

<Grid ColumnDefinitions="*, Auto" RowDefinitions="Auto, *">
    <Label Grid.Row="0" Text="First Name" />
    <Entry Grid.Row="1" />
</Grid>

The above Grid contains children in the * column only, while the Auto is empty. The following screenshot demonstrates how the layout appears initially:

image

After resizing the window, the layout appears correctly:

image

The above screenshot is on Windows, but similar problems can be observed on the other platforms as well.

Steps to Reproduce

  1. Run the sample project from the provided link.
  2. Observe the incorrect initial layout.
  3. Resize the window or rotate the phone/tablet.
  4. Observe the correct layout after resizing.

Link to public reproduction project repository

https://github.com/telerik/ms-samples/tree/main/Maui/GridStarAutoEmptyIncorrectLayout

Version with bug

8.0.0-preview.5.8529

Last version that worked well

7.0.86

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

N/A

Did you find any workaround?

No response

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created 2 months ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
ivan-todorov-progresscommented, Jul 25, 2023

@Stedy59 Thanks for the suggestion. I have a workaround for my particular scenario, but it is more involved. I am reporting a regression in the Grid layout that worked well with the latest official version, but was broken in the latest preview, in hope Microsoft would have enough time to fix it before .NET 8 goes official.

0reactions
hartezcommented, Aug 1, 2023

So this and #16368 are the same bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GridLayoutManager - how to auto fit columns?
You can calculate available number of columns, given a desired column width, and load the image as calculated. Define a static funtion to ......
Read more >
totalCount must not be null or less than the number of items
I've been looking through the forums and have checked that when there's no data being passed in, no data should be getting generated...
Read more >
GridLayout
A column or row that is sized Auto(true) tries to fit its own size to its content. When a GridLayout is solved, it...
Read more >
a!WriteRecords not working
Hi! I´m trying to write records using the a!writeRecords inside an interface. First of all, I save all the values of my editable...
Read more >
Use CSS Grid auto-fit For Responsive Column Layout
We'll complete our landing page styles by using CSS grid auto-fit in conjunction with the grid functions repeat and minmax.
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