From 51c1ffc6dde6a9e43f1b2efffcf06c5032b5f102 Mon Sep 17 00:00:00 2001 From: Tamilarasan Paranthaman Date: Mon, 7 Oct 2024 17:45:13 +0530 Subject: [PATCH 01/14] fixed label formatted text issue. --- src/Controls/src/Core/Label/Label.cs | 4 +- .../TestCases.HostApp/Issues/Issue24516.xaml | 20 ++++++++++ .../Issues/Issue24516.xaml.cs | 38 +++++++++++++++++++ .../Tests/Issues/Issue24516.cs | 28 ++++++++++++++ 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue24516.xaml create mode 100644 src/Controls/tests/TestCases.HostApp/Issues/Issue24516.xaml.cs create mode 100644 src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue24516.cs diff --git a/src/Controls/src/Core/Label/Label.cs b/src/Controls/src/Core/Label/Label.cs index d210b63dd87c..e0377e290ed3 100644 --- a/src/Controls/src/Core/Label/Label.cs +++ b/src/Controls/src/Core/Label/Label.cs @@ -55,7 +55,9 @@ public partial class Label : View, IFontElement, ITextElement, ITextAlignmentEle { var formattedString = ((FormattedString)oldvalue); var label = ((Label)bindable); - +#if WINDOWS + (label.Handler as LabelHandler)?.PlatformView?.TextHighlighters?.Clear(); +#endif formattedString.SpansCollectionChanged -= label.Span_CollectionChanged; formattedString.PropertyChanged -= label.OnFormattedTextChanged; formattedString.PropertyChanging -= label.OnFormattedTextChanging; diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue24516.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue24516.xaml new file mode 100644 index 000000000000..74dd4b36a340 --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue24516.xaml @@ -0,0 +1,20 @@ + + + + + +