We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Several SfTextInputLayouts inside a FlexLayout -> Exception: "Layout cycle detected. Layout could not complete."

this will throw  Microsoft.UI.Xaml.LayoutCycleException   -> message:  Layout cycle detected. Layout could not complete.

If you replace the FleyLayout with a StackLayout for example it works.

In order to be flexible in the layout depending on the appliaction width I want to be a


<FlexLayout Wrap="Wrap"
                            Direction="Row"
                            AlignContent="Start"
                            AlignItems="Start"
                            JustifyContent="SpaceAround">


                    <sfCore:SfTextInputLayout Hint="Category" ContainerType="Outlined" IsHintAlwaysFloated="true" WidthRequest="500" >
                        <Entry Text="{Binding SelectedTask.Category}" IsReadOnly="True"/>
                    </sfCore:SfTextInputLayout>
                    <sfCore:SfTextInputLayout Hint="Name" ContainerType="Outlined" IsHintAlwaysFloated="true" WidthRequest="500" >
                        <Entry Text="{Binding SelectedTask.Name}" IsReadOnly="True"/>
                    </sfCore:SfTextInputLayout>
                    <sfCore:SfTextInputLayout Hint="Duration" ContainerType="Outlined" IsHintAlwaysFloated="true" WidthRequest="500" >
                        <Entry Text="{Binding SelectedTask.Duration}" IsReadOnly="True"/>
                    </sfCore:SfTextInputLayout>
                    <sfCore:SfTextInputLayout Hint="Eta" ContainerType="Outlined" IsHintAlwaysFloated="true" WidthRequest="500" >
                        <Entry Text="{Binding SelectedTask.Eta}" IsReadOnly="True"/>
                    </sfCore:SfTextInputLayout>
                    <sfCore:SfTextInputLayout Hint="Progress" ContainerType="Outlined" IsHintAlwaysFloated="true" WidthRequest="500" >
                        <Entry Text="{Binding SelectedTask.Progress}" IsReadOnly="True"/>
                    </sfCore:SfTextInputLayout>
                    <sfCore:SfTextInputLayout Hint="TimestampUtcCreated" ContainerType="Outlined" IsHintAlwaysFloated="true" WidthRequest="500" >
                        <Entry Text="{Binding SelectedTask.TimestampUtcCreated}" IsReadOnly="True"/>
                    </sfCore:SfTextInputLayout>

                </FlexLayout>





4 Replies

AN Andreas April 29, 2023 12:00 PM UTC

the  "SelectedTask" Class looks like this



public sealed partial class BackgroundTask : ObservableObject
{
    [ObservableProperty]
    private string category;
    [ObservableProperty]
    private string name;


    [ObservableProperty]
    private TimeSpan eta;
    [ObservableProperty]
    private TimeSpan duration;


    [ObservableProperty]
    private double progress;
    [ObservableProperty]
    private ConcurrentStack<string> messages;


    public DateTime TimestampUtcCreated { get; set; }


}


AJ AhamedAliNishad JahirHussain Syncfusion Team May 1, 2023 10:34 AM UTC

Hi Andreas,

 

We were unable to reproduce the reported scenario on our end. To better understand the root cause and assist with resolving the issue, it would be helpful if you could provide more detailed information about the scenario in which our control was used, including a sample demonstrating the issue with replication steps. Please let us know if you have any other queries.

 

We have prepared a sample for you. Kindly review the attached example and apply any required modifications to reproduce the problem. Afterward, kindly forward the sample to us, as it would enable us to conduct a more thorough investigation of the issue.

 

Regards,

Ahamed Ali Nishad


Attachment: FlexTIL_baf1037.zip


AS Amit Saraf August 29, 2023 12:07 PM UTC

Hi,

I'm having same issue

please check

FlexLayout not working with multiple SfTextInputLayout inside it | .NET MAUI Forums | Syncfusion

Please let me know how you solved it.

Amit Saraf




BV Brundha Velusamy Syncfusion Team August 30, 2023 01:23 PM UTC

Hi Amit,

 

Thanks for contacting Syncfusion support

 

We would like to inform you that the reported problem occur in framework level when utilizing FlexLayout. We have informed the MAUI team on GitHub about this issue. Please follow the below link the tracking the reported issue and we will notify you once it was made available.

 

Please refer the below links for the framework issue:

https://github.com/dotnet/maui/issues/14048

https://github.com/dotnet/maui/issues/9075

 

We suggest a workaround to resolve the reported issue by providing the height request to the flex layout or the controls used inside the flex layout. We have created the workaround sample based on this and attached the sample for your reference.

 

Please take a look at the provided sample and feel free to reach out if you have any further questions or concerns.

 

Regards,
Brundha V


Attachment: TextInputLayoutSample_a8299714.zip

Loader.
Up arrow icon