Skip to content

FlexLayout misbehaves when Label content has long .Text #28165

@sjordanGSS

Description

@sjordanGSS

Description

When a FlexLayout contains a Label, and Label.Text is beyond a certain length relative to the length of the FlexLayout, FlexLayout will start layout its other children beyond it's own bounds.

Steps to Reproduce

  1. open the repro project
  2. a Label should be shown containing multiple 'A's, along with a red and blue box, however the boxes will be hidden, only the Label will be visible

Changing the FlexLayout's WidthRequest can also produce some funny results. Sometimes the red and blue boxes will appear, but the FlexLayout will break it's WidthRequest to do so. Changing the length of Label.Text can also cause strange things to happen.

Link to public reproduction project repository

https://github.com/sjordanGSS/flexlayout-grow-test

Version with bug

9.0.40 SR4

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Tested on Android 11 and 13

Did you find any workaround?

Setting FlexLayout.Basis="1" and FlexLayout.Grow="1" on the Label will stop it from pushing other controls around and occupy the remaining available space. This is not a complete workaround but was enough for my purposes.

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions