Share via

Highlighting text within a editor

Dani_S 5,581 Reputation points
2025-03-12T11:20:07.41+00:00

Hi,

I'm using .Net 9 with MAUI.

Highlighting text within a editor.

The highlight is not released.

Remains highlighted even after selecting other text.

User's image

<telerik:RadBorder Grid.Row="2" Grid.Column ="0"  BorderColor="{DynamicResource PrimaryColor}" BorderThickness="1" HorizontalOptions="Fill"  VerticalOptions="Fill" CornerRadius="5" Margin="10,5,10,10" >

<ScrollView  x:Name="scrollView" >

<Editor x:Name="editor"  AutoSize="TextChanges" IsSpellCheckEnabled="false" IsTextPredictionEnabled="false" Text="{Binding LogText, Mode=TwoWay}" 

   />

 </ScrollView>
</telerik:RadBorder>

Thanks,

Developer technologies | .NET | .NET Multi-platform App UI

Answer accepted by question author

Anonymous
2025-03-17T02:45:27.68+00:00

Hello,

Yes, I can reproduce this issue. Please add following EditorHandler in your application, when SelectionChanged, update the Editor's background.

#if WINDOWS
        Microsoft.Maui.Handlers.EditorHandler.Mapper.AppendToMapping("SelectionChanged", (handler, view) =>
        {
            handler.PlatformView.SelectionChanged += 
            new Microsoft.UI.Xaml.RoutedEventHandler((object sender, Microsoft.UI.Xaml.RoutedEventArgs e) =>
            {
                handler.PlatformView.UpdateBackground(view);
            });
        });
#endif

This issue was fixed in the .NET 9 SR4

Best Regards,

Leon Lu


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.