Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combination of FormattedString and TailTruncation problems #5669

Open
EislerDavid opened this issue Mar 22, 2019 · 7 comments
Open

Combination of FormattedString and TailTruncation problems #5669

EislerDavid opened this issue Mar 22, 2019 · 7 comments
Labels
3.6.0 regression on 3.6.0 e/3 🕒 3 help wanted We welcome community contributions to any issue, but these might be a good place to start! i/regression p/Android p/iOS 🍎 t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@EislerDavid
Copy link
Contributor

Description

When I use Label with LineBreakMode="TailTruncation" and set FormattedText with some spans then tail truncation is not working on iOS and freezes on Android.

Steps to Reproduce

  1. Create Label with LineBreakMode="TailTruncation"
  2. Set FormattedText with some spans
  • tail truncation not working on iOS and freezes on Android API22 and lower
  1. Add into FormattedText some new line characters
  • freezes on Android API23 and higher

Expected Behavior

iOS: Tail truncation on both Labels with FormattedText
Android: Tail truncation on both Labels with FormattedText

Actual Behavior

iOS: No truncation
Android API23 and higher: Application freezes when page appeared with new lines in text
Android API22 and lower: Application freezes when page appeared

Basic Information

  • Version with issue: 3.6.0.264807

  • Last known good version: 3.5.0.169047, but I'm not sure if 3.6.0.220655 is working

  • IDE: Microsoft Visual Studio Community 2017, Version 15.9.6

  • Platform Target Frameworks:

    • iOS: 12.1.4
    • Android: 7.0
  • Android Support Library Version: 28.0.0.1

  • Nuget Packages:
    Xamarin.Android.Arch.Core.Common 1.1.1.1
    Xamarin.Android.Arch.Core.Runtime 1.1.1.1
    Xamarin.Android.Arch.Lifecycle.Common 1.1.1.1
    Xamarin.Android.Arch.Lifecycle.LiveData 1.1.1.1
    Xamarin.Android.Arch.Lifecycle.LiveData.Core 1.1.1.1
    Xamarin.Android.Arch.Lifecycle.Runtime 1.1.1.1
    Xamarin.Android.Arch.Lifecycle.ViewModel 1.1.1.1
    Xamarin.Android.Support.Animated.Vector.Drawable 28.0.0.1
    Xamarin.Android.Support.Annotations 28.0.0.1
    Xamarin.Android.Support.AsyncLayoutInflater 28.0.0.1
    Xamarin.Android.Support.Collections 28.0.0.1
    Xamarin.Android.Support.Compat 28.0.0.1
    Xamarin.Android.Support.CoordinaterLayout 28.0.0.1
    Xamarin.Android.Support.Core.UI 28.0.0.1
    Xamarin.Android.Support.Core.Utils 28.0.0.1
    Xamarin.Android.Support.CursorAdapter 28.0.0.1
    Xamarin.Android.Support.CustomTabs 28.0.0.1
    Xamarin.Android.Support.CustomView 28.0.0.1
    Xamarin.Android.Support.Design 28.0.0.1
    Xamarin.Android.Support.DocumentFile 28.0.0.1
    Xamarin.Android.Support.DrawerLayout 28.0.0.1
    Xamarin.Android.Support.Fragment 28.0.0.1
    Xamarin.Android.Support.Interpolator 28.0.0.1
    Xamarin.Android.Support.Loader 28.0.0.1
    Xamarin.Android.Support.LocalBroadcastManager 28.0.0.1
    Xamarin.Android.Support.Media.Compat 28.0.0.1
    Xamarin.Android.Support.Print 28.0.0.1
    Xamarin.Android.Support.SlidingPaneLayout 28.0.0.1
    Xamarin.Android.Support.SwipeRefreshLayout 28.0.0.1
    Xamarin.Android.Support.Transition 28.0.0.1
    Xamarin.Android.Support.v4 28.0.0.1
    Xamarin.Android.Support.v7.AppCompat 28.0.0.1
    Xamarin.Android.Support.v7.CardView 28.0.0.1
    Xamarin.Android.Support.v7.MediaRouter 28.0.0.1
    Xamarin.Android.Support.v7.Palette 28.0.0.1
    Xamarin.Android.Support.v7.RecyclerView 28.0.0.1
    Xamarin.Android.Support.Vector.Drawable 28.0.0.1
    Xamarin.Android.Support.VersionedParcelable 28.0.0.1
    Xamarin.Android.Support.ViewPager 28.0.0.1
    Xamarin.Forms 3.6.0.264807

Reproduction Link

https://github.com/EislerDavid/FormattedTextSamplaProject

@pauldipietro pauldipietro added this to New in Triage Mar 22, 2019
@samhouts samhouts added this to the 3.6.0 milestone Mar 22, 2019
@samhouts samhouts added the e/3 🕒 3 label Mar 22, 2019
@samhouts samhouts moved this from New to Ready For Work in Triage Mar 22, 2019
@samhouts samhouts added this to To do in v3.6.0 Mar 24, 2019
@samhouts samhouts added this to To do in iOS Ready For Work Mar 29, 2019
@samhouts samhouts removed this from Ready For Work in Triage Mar 29, 2019
@adrianknight89
Copy link
Contributor

adrianknight89 commented Apr 5, 2019

Seeing this issue as well. On iOS, tail truncation does not work with spans.

I've also run into incorrect Label height calculations when spans are added (especially if a span is added towards the end of the line). The height of the label will be greater than what it should be (i.e. there is an extra empty line added even though the span text does not end with whitespace).

@KaelSuncaster
Copy link

Hi,

This is a major issue for us, functionally broken by simply updating to the latest Xamarin, something clients do not understand.

Is there any ETA for this?

@samhouts samhouts removed this from the 3.6.0 milestone Jun 21, 2019
@edebali
Copy link

edebali commented Jul 2, 2019

Hi, this issue is important for us, is there any plan for the fix? thanks

@melimion
Copy link
Contributor

Any update?

@MathewLC
Copy link
Contributor

This is related with two different errors #8831 and #7534.

@samhouts samhouts added the 3.6.0 regression on 3.6.0 label Jun 17, 2020
@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! and removed 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! labels Jul 17, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts added this to To do in vNext+1 (5.0.0) Aug 14, 2020
@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested and removed inactive Issue is older than 6 months and needs to be retested labels Sep 18, 2020
@samhouts samhouts added the help wanted We welcome community contributions to any issue, but these might be a good place to start! label Sep 18, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@arctouch-alexanderburov
Copy link

arctouch-alexanderburov commented Feb 1, 2021

When using FormattedText property on Label it generates NSAttributedString and sets to the UILabel.AttributedText property.
The issue with truncation is caused by the fact that built NSAttributedString has ParagraphStyle set which overrides LineBreakMode to the default word wrap.

I was able to fix that in renderer by regenerating NSAttributedString and setting LineBreakMode for the paragraph style in each range.

@Dids
Copy link

Dids commented Jun 1, 2021

This is still an active issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.6.0 regression on 3.6.0 e/3 🕒 3 help wanted We welcome community contributions to any issue, but these might be a good place to start! i/regression p/Android p/iOS 🍎 t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
v3.6.0
  
To do
Development

No branches or pull requests

9 participants