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

[regression/7.0.0] Elements in ColumnDefinition with star width are not displayed when the Grid is in a StackLayout #13993

Closed
dilyantraykov opened this issue Mar 16, 2023 · 1 comment · Fixed by #13999
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-7.0.86 Look for this fix in 7.0.86! fixed-in-7.0.92 Look for this fix in 7.0.92! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! i/regression This issue described a confirmed regression on a currently supported version partner Issue or Request from a partner team platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/bug Something isn't working

Comments

@dilyantraykov
Copy link

Description

Consider the following layout:

<StackLayout>
    <Grid ColumnDefinitions="Auto, *">
        <Rectangle />
        <Label Grid.Column="1" Text="Label" />
    </Grid>
</StackLayout>

The Label is not displayed when using the unofficial version from the release/7.0.2xx branch.

For comparison, the Label is displayed as expected with version 7.0.59.

Most probably the issue occurs due to the following change: #13395

Steps to Reproduce

  1. Run the project from the referenced reproduction repository.

Expected Behavior: The Label defined in XAML is displayed as expected.
Actual Behavior: The Label is not displayed.

Link to public reproduction project repository

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

Version with bug

Unknown/Other (please specify)

Last version that worked well

7.0 (current)

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

Windows SDK 10.0.19041.0, Android 33

Did you find any workaround?

No response

Relevant log output

No response

@dilyantraykov dilyantraykov added the t/bug Something isn't working label Mar 16, 2023
@jsuarezruiz jsuarezruiz added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter partner Issue or Request from a partner team i/regression This issue described a confirmed regression on a currently supported version labels Mar 16, 2023
@PureWeen
Copy link
Member

@hartez thoughts?

@hartez hartez added the backport/suggested The PR author or issue review has suggested that the change should be backported. label Mar 16, 2023
hartez added a commit that referenced this issue Mar 17, 2023
…ined (#13999)

* Ensure that Grid is treating star rows/columns as Auto when unconstrained
Fixes #13993

* Auto-format source code

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
mattleibow added a commit that referenced this issue Mar 17, 2023
* Removed BuildTizenDefaultTemplate and just have it call RadioButton's default template since they were identical. (#13996)

* Reinstate WebView cookie functionality for Android & iOS (#13736)

* Fix iOS cookies

* Fix Android Cookies

* Update src/Core/src/Platform/iOS/MauiWKWebView.cs

Co-authored-by: Manuel de la Pena <[email protected]>

* Auto-format source code

* Update MauiWKWebView.cs

* Update src/Core/src/Platform/iOS/MauiWKWebView.cs

---------

Co-authored-by: Manuel de la Pena <[email protected]>
Co-authored-by: GitHub Actions Autoformatter <[email protected]>

* Revert 10759. Fix Button sizing using HorizontalOptions. (#14005)

* Ensure that Grid is treating star rows/columns as Auto when unconstrained (#13999)

* Ensure that Grid is treating star rows/columns as Auto when unconstrained
Fixes #13993

* Auto-format source code

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>

* [iOS] Implement ScrollView Orientation (#13657)

* [iOS] Remove not used mapper for ContentSize

* [iOS] Implement Orientation mapping

* [Samples] Add sample page for ScrollView orientation

* Try without this

* [iOS] Move from extension to helper

* Add back removed API

* Use SetNeedsLayout to call measure of ContentView

* Cleanup

* [Android] Fix Frame Renderer to use Wrapper View correctly (#12218)

* [Android] Fix Frame to call missing mapper methods

* - fix rebase

* Auto-format source code

* - update tests and wrapper view code

* - remove code that's now generalized in ViewHandler

* - cleanup frame renderer

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>

* [controls] fix cases a GC causes events to not fire (#13997)

As seen in #13973, some of my recent changes had a flaw:

* #13550
* #13806
* #13656

Because nothing held onto the `EventHandler` in some of these cases,
at some point a GC will prevent future events from firing.

So for example, my original attempt to test this behavior:

    [Fact]
    public async Task RectangleGeometrySubscribed()
    {
        var geometry = new RectangleGeometry();
        var visual = new VisualElement { Clip = geometry };

        bool fired = false;
        visual.PropertyChanged += (sender, e) =>
        {
            if (e.PropertyName == nameof(VisualElement.Clip))
                fired = true;
        };

        // Was missing these three lines!!!
        // await Task.Yield();
        // GC.Collect();
        // GC.WaitForPendingFinalizers();

        geometry.Rect = new Rect(1, 2, 3, 4);
        Assert.True(fired, "PropertyChanged did not fire!");
    }

In each case, I added an additional test showing the problem.

I played around with some ideas, but the simplest solution is to save
the `EventHandler` in a member field of the subscriber. Will keep
thinking of smarter ways to handle this.

I also fixed several GC-related tests that were ignored, hoping they
might help find issues in this area. My `await Task.Yield()` trick was
enough to make them pass.

* Fix tests in Release mode

In `Release` mode, a `GC.KeepAlive()` call is needed for the tests to pass.

Co-authored-by: GitHub Actions Autoformatter <[email protected]>

* [iOS] Scroll with the keyboard to not block entries and editors (#13499)

---------

Co-authored-by: dustin-wojciechowski <[email protected]>
Co-authored-by: Gerald Versluis <[email protected]>
Co-authored-by: Manuel de la Pena <[email protected]>
Co-authored-by: GitHub Actions Autoformatter <[email protected]>
Co-authored-by: Javier Suárez <[email protected]>
Co-authored-by: E.Z. Hart <[email protected]>
Co-authored-by: Rui Marinho <[email protected]>
Co-authored-by: Shane Neuville <[email protected]>
Co-authored-by: Jonathan Peppers <[email protected]>
Co-authored-by: TJ Lambert <[email protected]>
@PureWeen PureWeen removed the backport/suggested The PR author or issue review has suggested that the change should be backported. label Mar 23, 2023
PureWeen pushed a commit that referenced this issue Mar 23, 2023
…unconstrained (#14165)

* Ensure that Grid is treating star rows/columns as Auto when unconstrained Fixes #13993

* Auto-format source code

---------

Co-authored-by: E.Z. Hart <[email protected]>
Co-authored-by: GitHub Actions Autoformatter <[email protected]>
@samhouts samhouts added the fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! label Apr 12, 2023
@samhouts samhouts added this to the .NET 8 milestone Apr 12, 2023
rmarinho pushed a commit that referenced this issue Apr 17, 2023
…unconstrained (#14165)

* Ensure that Grid is treating star rows/columns as Auto when unconstrained Fixes #13993

* Auto-format source code

---------

Co-authored-by: E.Z. Hart <[email protected]>
Co-authored-by: GitHub Actions Autoformatter <[email protected]>
@samhouts samhouts added the fixed-in-7.0.86 Look for this fix in 7.0.86! label May 10, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jun 9, 2023
@samhouts samhouts modified the milestones: .NET 8, .NET 7 + Servicing Jul 10, 2023
@samhouts samhouts added the fixed-in-7.0.92 Look for this fix in 7.0.92! label Jul 11, 2023
@samhouts samhouts changed the title Elements in ColumnDefinition with star width are not displayed when the Grid is in a StackLayout [regression/7.0.0] Elements in ColumnDefinition with star width are not displayed when the Grid is in a StackLayout Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-7.0.86 Look for this fix in 7.0.86! fixed-in-7.0.92 Look for this fix in 7.0.92! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! i/regression This issue described a confirmed regression on a currently supported version partner Issue or Request from a partner team platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants