Skip to content

FlexLayout.Grow="1" text cuts off instead of line break on Windows #22371

@sknochen

Description

@sknochen

Description

If a FlexLayout, containing multiple items with Grow set to "1" and including texts of varying lengths (such as Labels and Buttons), is added to a page, the text may get cut off when multiple items are in the same row.
On Android (normal and Samsung DeX) and iOS this bug does not occur.

grafik

If there is only one item in a Row, the text will break over multiple lines as expected:

grafik

Steps to Reproduce

  1. Create a new MAUI app
  2. Add the xaml code below to the page
  3. Start app on Windows
  4. Change the width of the window to see different occurences

Expected
The text of the Labels and Buttons breaks over multiple lines

Actual
The text of the Labels and Buttons gets cut off

<FlexLayout Wrap="Wrap">
    <VerticalStackLayout Spacing="8" FlexLayout.Grow="1">
        <Label Text="This is a long looong looooong Text, please don't cut me off" LineBreakMode="CharacterWrap" />
        <Label Text="Short Text" />
    </VerticalStackLayout>
    <VerticalStackLayout Spacing="8"  FlexLayout.Grow="1">
        <Label Text="Short Text" />
        <Label Text="Short Text" />
    </VerticalStackLayout>
    <VerticalStackLayout Spacing="8" FlexLayout.Grow="1">
        <Label Text="Short Text" />
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Label Text="Look at my right neighbor" />
            <Button Grid.Column="1" Text="I am the neighbor" />
        </Grid>
    </VerticalStackLayout>
    <VerticalStackLayout Spacing="8" FlexLayout.Grow="1">
        <Label Text="Short Text" />
        <Label Text="Short Text" />
    </VerticalStackLayout>        
    <VerticalStackLayout Spacing="8" FlexLayout.Grow="1">
        <Label Text="Short Text" />
        <Button Text="This is a long looong looooong looooooong loooooooooong loooooooooooong Text" />
    </VerticalStackLayout>
</FlexLayout>

Link to public reproduction project repository

No response

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows SDK 10.22621.0

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

area-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterlayout-flexFlexLayout issuesplatform/windowss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions