dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.72k forks source link

Line break modes are not working on html text type #24298

Open ziomek64 opened 3 weeks ago

ziomek64 commented 3 weeks ago

Description

As in the title, can't get line break modes such as headtruncation or tailtruncation, or any for that matter to work with html text type.

Is this intended, or is this some sort of limitation? It's not mentioned in label docs.

I was only able to test it on Android since I'm on linux.

Version with bug

8.0.80 SR8

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 3 weeks ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

jfversluis commented 3 weeks ago

Maybe this specific case isn't mentioned explicitly, but in the docs there is this

For example, Android supports only a subset of HTML tags, focusing on basic styling and formatting for block level elements such as and

So I think its safe to say that this is just not supported and you probably want to find another way to do it. The .NET MAUI Label control has truncation, why not use that one?

ziomek64 commented 3 weeks ago

Maybe this specific case isn't mentioned explicitly, but in the docs there is this

For example, Android supports only a subset of HTML tags, focusing on basic styling and formatting for block level elements such as and

So I think its safe to say that this is just not supported and you probably want to find another way to do it. The .NET MAUI Label control has truncation, why not use that one?

I am using a label, but with TextType set to html, since I'm getting html from API. And it works great but truncation from maui is not working for me

ziomek64 commented 3 weeks ago

@samhouts Is this closed as not planned? I've explained I am using a label.

samhouts commented 3 weeks ago

@ziomek64 Can you link to a small reproduction project, maybe? It might make the problem more clear. Thanks!

ziomek64 commented 3 weeks ago

@ziomek64 Can you link to a small reproduction project, maybe? It might make the problem more clear. Thanks!

https://github.com/ziomek64/linebreakrepro

There are 3 borders with labels

  1. Normal text
  2. Normal text with html text type (truncation not working)
  3. Text with html tags and html text type (truncation not working)

As I said, html tags work great, but truncation from maui label is not working

QianaJiao commented 3 hours ago

This issue has been verified using Visual Studio 17.12.0 Preview 2.0 (9.0.0-rc.1.24453.9 & 8.0.82) & VS 17.11.3 7.0.101. Can repro on Android platform.