Skip to content

Label doesn't render correctly when in a Grid with column definitions #10494

@dimitar-sd

Description

@dimitar-sd

Description

  1. Label that is set with the end trailing doesn't display the trailing dots (...)
  2. Label that is set with MaxLines="3" doesn't always display the 2nd and 3rd lines when in a grid (there is a situation when the 3 lines are rendered but the grid size expands only to the first line and the 2nd and 3rd lines are visible outside of the grid).

Steps to Reproduce

This example would display only two lines. One from row 1 and another from row 2.
What is expected is to see more than one lines in the 2nd row.
(Look for a picture in the comments bellow.)

<Grid 
  RowDefinitions="auto,auto"
  ColumnDefinitions="auto,*,auto"
  BackgroundColor="LightBlue"
  VerticalOptions="Start"
  >

  <!-- first line -->
  <Label
      Margin="0,16,0,0"
      VerticalOptions="Start"
      HorizontalOptions="Start"
      Grid.Row="0"
      LineBreakMode="TailTruncation"
      Text="s{Binding CustomerName} HHHHHHHHH HHHHHHHHH HHHHHHHHHHH HHHHHHHHHHH"
      FontSize="16"
      />

  <!-- second line -->
  <Label
      Grid.Row="1"
      Margin="0,0,16,16"
      VerticalOptions="Start"
      HorizontalOptions="Start"
      LineBreakMode="WordWrap"
      Text="x{Binding Notes}xxxxxxxx OO xxxxxxxxxxxHHHHH xxxxxxxxxxxx xxxxxxxxxxxxx xxxxxx xxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxxx xxxxxx 333333333333333333333"
      MaxLines="3"
      LineHeight="1"
      FontSize="12"
      BackgroundColor="Yellow"
      />


</Grid>

Link to public reproduction project repository

none, example provided in the description

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.4

Did you find any workaround?

if the columns definitions are removed it would render correctly. In real scenario the columns are needed and can't be removed.

Relevant log output

No response

Metadata

Metadata

Labels

area-controls-labelLabel, Spanlayout-gridp/1Work that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions