[iOS]Fix for Character Spacing Not Updating Correctly in Editor for Dynamically Added Text#25347
Merged
jfversluis merged 26 commits intodotnet:mainfrom Jan 31, 2025
Merged
Conversation
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
reviewed
Oct 22, 2024
| Platform.TextExtensions.UpdateText(handler.PlatformView, editor); | ||
|
|
||
| // Any text changes in the editor field require recalculating the CharacterSpacing by regenerating the attributed string to properly apply the spacing and override the current text formatting. | ||
| if (editor.CharacterSpacing > 0) |
Contributor
There was a problem hiding this comment.
Can invalidate CharacterSpacing just doing:
handler?.UpdateValue(nameof(CharacterSpacing));
Contributor
Author
There was a problem hiding this comment.
Thanks for the suggestion! I've updated the code as per your recommendation, using handler?.UpdateValue(nameof(CharacterSpacing));
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
Author
|
/rebase |
57d3160 to
e889545
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
Author
|
/rebase |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
Author
|
/rebase |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Azure Pipelines successfully started running 3 pipeline(s). |
…sLayout is set for Tablet but not on mobile devices (dotnet#26152)" This reverts commit 0ddc794.
…msLayout is set for Tablet but not on mobile devices (dotnet#26152)" This reverts commit 4b9074c.
Contributor
|
/rebase |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
approved these changes
Jan 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause
The text was initially loaded with CharacterSpacing and then mapped as AttributedText for the native UITextView text. However, when characters were dynamically added in the editor field, the current text mapped as the simple text without considering the CharacterSpacing for the native AttributedText for the UITextView, which caused the issue.
Description of Change
We are recreating the character mapping whenever the text changes with CharacterSpacing Value. This approach resolves the issue and ensures the functionality works as intended
Validated the behaviour in the following platforms
Issues Fixed
Fixes #17782
Output Screenshot
Mac.Before.Fix.mp4
Mac.After.Fix.mp4
iOS.Before.fix.1.mov
iOS.After.Fix.1.mov