[iOS, Android, Windows] TextTransform Property Does Not Apply at Runtime When TextType="Html" Is Set on Label - fix#29700
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. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the TextTransform property is not applied at runtime when TextType="Html" is set on a Label in iOS. Key changes include updating the method signature of UpdateTextHtml to accept a string parameter and ensuring that the transformed text is passed consistently in platform-specific extension calls.
- Change UpdateTextHtml’s signature to accept a string.
- Update call sites in the iOS extension to pass the transformed text.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Core/src/Platform/iOS/LabelExtensions.cs | Updated internal method signature to accept a string instead of an ILabel instance. |
| src/Controls/src/Core/Platform/iOS/Extensions/LabelExtensions.cs | Modified calls to UpdateTextHtml to pass the locally transformed text and simplified text assignment. |
Comments suppressed due to low confidence (1)
src/Controls/src/Core/Platform/iOS/Extensions/LabelExtensions.cs:19
- [nitpick] Passing the transformed text directly streamlines the processing. Confirm that no additional in-method transformations are expected in UpdateTextHtml.
platformLabel.UpdateTextHtml(text);
| } | ||
|
|
||
| internal static void UpdateTextHtml(this UILabel platformLabel, ILabel label) | ||
| internal static void UpdateTextHtml(this UILabel platformLabel, string text) |
There was a problem hiding this comment.
The method signature for UpdateTextHtml has been updated to take a string instead of an ILabel. Please ensure that all internal calls pass the correctly transformed text to avoid inconsistencies.
|
FYI #29685 Nothing actionable here, just cross-linking. |
mattleibow
left a comment
There was a problem hiding this comment.
Looks good.
This probably can do with just a device test as there is not a feature in the OS so the actual text is different.
Just a nit on the public method looking like it has changed.
jsuarezruiz
left a comment
There was a problem hiding this comment.
Looking good but, could include a test?
added |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@kubaflo can you rebase when you get a chance |
… Is Set on Label (#29700)
Eliminates an unnecessary call to _scalingCanvas.Scale in PlatformGraphicsView. The scaling is already handled by adjusting the dirtyRect dimensions, preventing double scaling. TextTransform Property Does Not Apply at Runtime When TextType="Html" Is Set on Label (dotnet#29700)
… Is Set on Label (#29700)
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Issues Fixed
Fixes #29673
Screen.Recording.2025-05-28.at.00.57.18.mov
Screen.Recording.2025-05-28.at.00.56.12.mov
I was curious how the text would behave if we used something like:
"<b>HTML <span style=\"text-transform:uppercase\">Lorem ipsum dolor sit amet</span>, consectetur adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus</b>";It turned out that the label property was overridden by the CSS style, which I believe is the correct and expected behavior. This applies to iOS, where the text-transform: uppercase style works as intended. However, on Android, the has no effect — the text remains unchanged.