-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS] Html label not applying bold or italics #20488
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
base: main
Are you sure you want to change the base?
[iOS] Html label not applying bold or italics #20488
Conversation
|
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. |
|
/rebase |
50f4656 to
c797cf6
Compare
| if (newFont != null) | ||
| { | ||
| // Modify the font size | ||
| newFont = newFont.WithSize((nfloat)fontSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c797cf6 to
91f3fd6
Compare
|
@crobibero Thank you for catching that! The device tests also found it, but it is cool that you actually tested it |
|
@crobibero @jsuarezruiz demo: Screen.Recording.2024-02-12.at.14.22.13.mov |
mattleibow
left a comment
There was a problem hiding this 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?
| if (handler.PlatformView?.AttributedText != null) | ||
| handler.PlatformView?.UpdateTextHtml(label); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
91f3fd6 to
3da4444
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
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 |
|
it seems that this issue was completely forgotten for months |
e3efd4f to
5f2b4df
Compare
|
@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 successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
42ceadf to
73ca136
Compare
|
/azp run |
|
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) |
There was a problem hiding this comment.
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?
73ca136 to
5f7b08e
Compare
|
/rebase |
5f7b08e to
b57c43c
Compare
b57c43c to
44fac2e
Compare




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
UpdateTextHtmlextension methodIssues Fixed
Fixes #20372
Screen.Recording.2024-02-12.at.14.22.13.mov