Skip to content
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

[Windows] Fix Span Foreground property #24063

Merged
merged 5 commits into from
Aug 22, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public static void UpdateInlines(
Foreground = textColor?.ToPlatform(),
};

run.Foreground = textColor?.ToPlatform();
textBlock.TextHighlighters.Add(textHighlighter);
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue23488.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.Issues.Issue23488">

<StackLayout HorizontalOptions="Center"
VerticalOptions="Center">
<Label Text="hyperlink"
TextColor="Blue"
TextDecorations="Underline" />
<Label AutomationId="WaitForLabelControl">
<Label.FormattedText>
<FormattedString>
<Span Text="hyperlink"
TextColor="Blue"
TextDecorations="Underline" />
</FormattedString>
</Label.FormattedText>
</Label>
</StackLayout>

</ContentPage>
12 changes: 12 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue23488.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Maui.Controls.Sample.Issues
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[Issue(IssueTracker.Github, 23488, "Span text-decoration is incorrect whereas the Label behaves properly", PlatformAffected.UWP)]
public partial class Issue23488 : ContentPage
{
public Issue23488()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#if !MACCATALYST
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues
{
public class Issue23488 : _IssuesUITest
{
public Issue23488(TestDevice device): base(device)
{
}

public override string Issue => "Span text-decoration is incorrect whereas the Label behaves properly";

[Test]
[Category(UITestCategories.Label)]
public void LabelHyperlinkUnderlineColor()
{
App.WaitForElement("WaitForLabelControl");
VerifyScreenshot();
}
}
}
#endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading