Skip to content

Conversation

@kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Feb 10, 2024

Description of Change

HTML attributes have been disregarded when updating the text size. Therefore, a fix relies on separately updating the font size for HTML in the UpdateTextHtml extension method

Issues Fixed

Fixes #20372

Demo
Screen.Recording.2024-02-12.at.14.22.13.mov
Before After

@kubaflo kubaflo requested a review from a team as a code owner February 10, 2024 02:07
@ghost ghost added the community ✨ Community Contribution label Feb 10, 2024
@ghost
Copy link

ghost commented Feb 10, 2024

Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@crobibero
Copy link

Looks like this removes the ability to also set a font family. I used Dokdo because it is included in the sample controls app

8.0.10-nightly-10006
image

This branch:
image

@rmarinho
Copy link
Member

/rebase

@github-actions github-actions bot force-pushed the html-label-not-applying-bold-or-italics branch from 50f4656 to c797cf6 Compare February 12, 2024 01:57
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Feb 12, 2024
if (newFont != null)
{
// Modify the font size
newFont = newFont.WithSize((nfloat)fontSize);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@kubaflo kubaflo force-pushed the html-label-not-applying-bold-or-italics branch from c797cf6 to 91f3fd6 Compare February 12, 2024 13:23
@kubaflo
Copy link
Contributor Author

kubaflo commented Feb 12, 2024

@crobibero Thank you for catching that! The device tests also found it, but it is cool that you actually tested it

@kubaflo
Copy link
Contributor Author

kubaflo commented Feb 12, 2024

@crobibero @jsuarezruiz demo:

Screen.Recording.2024-02-12.at.14.22.13.mov

Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR and the tests! This looks good, except I notice that we have some weird mix of Controls code in Core, which I am not sure we shuld have ever gotten to. HTML text is not part of Core, so I am thinking we should avoid calling any of the related functins in Core directly. Not sure if any other folks on the team have opinions/thoughts?

Comment on lines 67 to 68
if (handler.PlatformView?.AttributedText != null)
handler.PlatformView?.UpdateTextHtml(label);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this extensin method is in core as it is not used/meant to be in core. I think this should rather be done from Controls in a AppendToMapping... Then that can maybe trigger a Text changed.

@PureWeen @jsuarezruiz should this HTML extension method actually be moved to Controls so we don't start doing Controls things in Core and it is all mixed up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. @kubaflo Could you apply the changes?. Or let me know and I can do it.

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kubaflo kubaflo force-pushed the html-label-not-applying-bold-or-italics branch from 91f3fd6 to 3da4444 Compare April 10, 2024 22:52
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz jsuarezruiz self-requested a review June 13, 2024 10:10
@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Jun 13, 2024

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@sscwelsh
Copy link

sscwelsh commented Jul 8, 2024

What is the status on this? It has been open for months on the tests. I have a client that is trying to use the HTML label to display more formatting and this is the last hang up for the application to go to production

@davidchieregato
Copy link

it seems that this issue was completely forgotten for months

@kubaflo kubaflo force-pushed the html-label-not-applying-bold-or-italics branch from e3efd4f to 5f2b4df Compare September 19, 2024 14:55
@kubaflo
Copy link
Contributor Author

kubaflo commented Sep 19, 2024

@sscwelsh @davidchieregato The MAUI team's priorities are not up to me, but you can have this fix in your app by following this @jfversluis's video if it is a major blocker for your migration https://www.youtube.com/watch?v=B2FOBjZKm9k&t=301s&pp=ygUWZ2VyYWxkIG1hdWkgcHIgdGVzdGluZw%3D%3D

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the html-label-not-applying-bold-or-italics branch from 42ceadf to 73ca136 Compare October 31, 2024 12:03
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

attributedString.EnumerateAttributes(new NSRange(0, attributedString.Length), NSAttributedStringEnumeration.None,
(NSDictionary attrs, NSRange range, ref bool stop) =>
{
if (label!.Font.Family == null)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is only applied on default font family? What if users using custom font?

@kubaflo kubaflo force-pushed the html-label-not-applying-bold-or-italics branch from 73ca136 to 5f7b08e Compare November 15, 2024 09:38
@jsuarezruiz
Copy link
Contributor

/rebase

@github-actions github-actions bot force-pushed the html-label-not-applying-bold-or-italics branch from 5f7b08e to b57c43c Compare November 27, 2024 16:19
@kubaflo kubaflo force-pushed the html-label-not-applying-bold-or-italics branch from b57c43c to 44fac2e Compare March 8, 2025 01:21
@kubaflo kubaflo self-assigned this Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML Label not applying Bold or Italics on iOS

9 participants