Skip to content

[iOS] Fix Label Span formatting test failures on candidate branch#35815

Merged
kubaflo merged 1 commit into
dotnet:inflight/candidatefrom
Vignesh-SF3580:fix-failures31159
Jun 9, 2026
Merged

[iOS] Fix Label Span formatting test failures on candidate branch#35815
kubaflo merged 1 commit into
dotnet:inflight/candidatefrom
Vignesh-SF3580:fix-failures31159

Conversation

@Vignesh-SF3580

Copy link
Copy Markdown
Contributor

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!

Issue Details

PR #31159 ("Improve Label Mapping Performance") introduced a regression in three iOS Label snapshot tests:

  • SpanShouldInheritStyleFromLabel
  • VerifyLineHeightRendering
  • VerifySpanInheritsLabelCharacterSpacing

As a result, Spans lose font attributes, line height, and character spacing inherited from the Label.

Root Cause

In Label.Mapper.cs, MapFont was modified to include && !handler.IsConnectingHandler() in the HasFormattedTextSpans check. During handler connection, this causes execution to fall through to baseMethod, which ultimately calls UILabel.Font = .... On iOS, setting UILabel.Font after AttributedText has already been assigned recreates the attributed string, removing the span-level formatting (such as bold/italic styling, line height, and character spacing) that was previously applied by MapText.

Test names:

  • SpanShouldInheritStyleFromLabel
  • VerifyLineHeightRendering
  • VerifySpanInheritsLabelCharacterSpacing

Description of Change

Restructured MapFont so that when HasFormattedTextSpans is true, execution never falls through to baseMethod.
During handler connection, the redundant UpdateValue(FormattedText) call is still skipped to preserve the performance optimization introduced in PR #31159. However, UpdateFont is no longer called, preventing the already-correct AttributedText from being overwritten and preserving all span-level formatting.

Cause PR: #31159

Output

Before Issue Fix After Issue Fix

Test result

Before Issue Fix After Issue Fix

@Vignesh-SF3580 Vignesh-SF3580 added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Jun 9, 2026
@github-actions github-actions Bot added the area-controls-label Label, Span label Jun 9, 2026
@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@Vignesh-SF3580 Vignesh-SF3580 marked this pull request as ready for review June 9, 2026 08:06
@sheiksyedm sheiksyedm requested a review from kubaflo June 9, 2026 15:27
@kubaflo kubaflo merged commit 459b479 into dotnet:inflight/candidate Jun 9, 2026
38 of 50 checks passed
@github-actions github-actions Bot added this to the .NET 10.0 SR8 milestone Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-label Label, Span community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants