Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Controls/src/Core/Label/Label.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal static void MapFormatting(ILabelHandler handler, Label label)
{
LabelHandler.MapFormatting(handler, label);
}
else
else if (!label.HasFormattedTextSpans && label.TextType == TextType.Html) // we need to re-apply color and font for HTML labels
{
handler.UpdateValue(nameof(ILabel.TextColor));
handler.UpdateValue(nameof(ILabel.Font));
Expand Down
23 changes: 23 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue29851.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 29851, "[iOS] FormattedText with text color causes stack overflow", PlatformAffected.All)]
public class Issue29851 : TestContentPage
{
protected override void Init()
{
Content = new Label
{
AutomationId = "label",
TextColor = Colors.Green,
FormattedText = new FormattedString
{
Spans =
{
new Span { Text = "Hello, World!" },
new Span { Text = "*", TextColor = Colors.Red }
}
}
};
;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue29851 : _IssuesUITest
{

public Issue29851(TestDevice testDevice) : base(testDevice) { }

public override string Issue => "[iOS] FormattedText with text color causes stack overflow";

[Test]
[Category(UITestCategories.Label)]
public void FormattedTextWithTextColorDoesNotCrash()
{
App.WaitForElement("label");
}
}
Loading