Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[FlexLayout] Labels with word wrap do not seem to auto calculate height correctly #4950

Open
mattregul opened this issue Jan 10, 2019 · 7 comments
Labels
a/flex a/layout e/6 🕕 6 help wanted We welcome community contributions to any issue, but these might be a good place to start! inactive Issue is older than 6 months and needs to be retested t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@mattregul
Copy link
Member

Description

Text can be cut off/truncated when there are several FlexLayout's with Labels, filling a StackLayout

In the example below, 8 lines of text are assigned to the label, but when rendered to the screen (only tested on Android phone) only 5 lines are displayed before truncation

<StackLayout VerticalOptions="FillAndExpand" Padding="70,5,0,0">
            <FlexLayout Direction="Row" Wrap="Wrap">
                <Label FlexLayout.Grow="1" FlexLayout.Basis="100" Text="NOTES"/>
                <Label FlexLayout.Grow="2" FlexLayout.Basis="150"
                    Text="1This is a test to see if the word wrap will not cut off. 
                          2This is a test to see if the word wrap will not cut off. 
                          3This is a test to see if the word wrap will not cut off. 
                          4This is a test to see if the word wrap will not cut off. 
                          5This is a test to see if the word wrap will not cut off. 
                          6This is a test to see if the word wrap will not cut off. 
                          7This is a test to see if the word wrap will not cut off. 
                          8This is a test to see if the word wrap will not cut off. "/>
            </FlexLayout>
            <FlexLayout Direction="Row" Wrap="Wrap">
                <Label FlexLayout.Grow="1" FlexLayout.Basis="100" Text="NOTES"/>
                <Label FlexLayout.Grow="2" FlexLayout.Basis="150"
                    Text="1This is a test to see if the word wrap will not cut off. 
                          2This is a test to see if the word wrap will not cut off. 
                          3This is a test to see if the word wrap will not cut off. 
                          4This is a test to see if the word wrap will not cut off. 
                          5This is a test to see if the word wrap will not cut off. 
                          6This is a test to see if the word wrap will not cut off. 
                          7This is a test to see if the word wrap will not cut off. 
                          8This is a test to see if the word wrap will not cut off. "/>
            </FlexLayout>

(copy/paste FlexLayout several more times)
  ...

Steps to Reproduce

Expected Behavior

Display all text within the top-most FlexLayouts

Actual Behavior

Text is being truncated in each label. (in order to fit more controls on the screen?)

Basic Information

  • Version with issue:
    • Xamarin Form 3.4.0.1009999

Screenshots

image

Reproduction Link

@mattregul
Copy link
Member Author

Additional details from the forum post:

this is not only an issue with text wrapping, but also wrapping content within flex layout. If you have a view with multiple content containers (some being flex wrap), the overall height has issues calculating.

@kingces95
Copy link
Contributor

Reproduces as reported.

@pizzahead24
Copy link

#4875

@pizzahead24
Copy link

Considering there are medical charting apps and such that contain med data that users have to read and cant because of this cut off bug I would imagine this bug should be higher prioritized.

@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Oct 2, 2019
@KishanRathod
Copy link

Wrapping the Label with StackLayout fixed the issue for me.

@samhouts samhouts removed the inactive Issue is older than 6 months and needs to be retested label Mar 15, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts added the inactive Issue is older than 6 months and needs to be retested label Sep 18, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@abhcr
Copy link

abhcr commented Mar 31, 2021

Avoid using padding within the label. Instead, wrap it with a stack layout and then give it the padding.

@somoreingold
Copy link

Removing padding does not solve all cases. Can we please remove the "inactive" label on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/flex a/layout e/6 🕕 6 help wanted We welcome community contributions to any issue, but these might be a good place to start! inactive Issue is older than 6 months and needs to be retested t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

No branches or pull requests

7 participants