RichEditBox raises TextChanged event when spellcheck detects misspelt word #9898
Labels
area-TextBox
TextBox, RichEditBox
bug
Something isn't working
closed-ByDesign
Described behavior is by design.
team-Controls
Issue for the Controls team
Describe the bug
The
Microsoft.UI.Xaml.Controls.RichEditBox
raises itsTextChanged
event when the spellcheck detects a misspelt word even though the text did not actually change.Steps to reproduce the bug
To demonstrate the issue, create a new blank WinUI 3 app project in Visual Studio and put the following code in your
MainWindow.xaml
andMainWindow.xaml.cs
files:MainWindow.xaml
:MainWindow.xaml.cs
:The issue is only reproducible, when the user has written some text in the RichEditBox before. I assume, that spellcheck does not kick in, when the user has never written any text in the RichEditBox before.
So, please enter some text in the RichEditBox and then press the SetText() button. This will replace the text in the RichEditBox with some very long text with a misspelt word at the end and then subscribe an event-handler to the TextChanged event. The purpose for the wall of text before the misspelt word is to create some delay, so that the issue is easier to see.
You will see, that the TextChanged event will be raised as soon as the spellcheck detects and underlines the misspelt word "qw".
Expected behavior
When spellcheck detects a misspelt word, it should not raise a TextChanged event, because the text did not actually change.
Screenshots
Edit: https://youtu.be/cTotf9H2LXw
NuGet package version
WinUI 3 - Windows App SDK 1.5.6: 1.5.240802000
Windows version
Windows 10 (21H2): Build 19044
Additional context
No response
The text was updated successfully, but these errors were encountered: