Skip to content

Layout Cycle Detected when a Flexlayout is inside a StackLayout on Windows #11909

@YiannisBourkelis

Description

@YiannisBourkelis

Description

Having a FlexLayout inside a StackLayout is causing Visual Studio to detect a " Layout Cycle " and throw an exception.
The issue appears only when running on Windows. On iOS/Android/MacCatalyst it just loads an empty page.

To reproduce the issue run the attached reproducible project or simply paste this code in a page (Targeting Windows):

    <ContentPage.Content>
        <StackLayout>
            <FlexLayout>
                <Label Text="ok" />
            </FlexLayout>
        </StackLayout>
    </ContentPage.Content>

This is the error on Visual Studio:
layout_cycle_detected_issue

The error messages I got are two:

  1. A Cycle occurred while laying out the GUI
    Layout cycle detected. Layout could not complete

  2. Element not found

This issue might be related with #9905

Steps to Reproduce

Run the attached reproducible project and click on the "CLICK HERE ... " button

Link to public reproduction project repository

https://github.com/YiannisBourkelis/maui_issues/tree/main/src/LayoutCycleFlexLayoutIssue

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

Windows 10

Did you find any workaround?

No

Relevant log output

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions