This is a migrated thread and some comments may be shown as answers.

Check-spelling-as-you-type and non-space word separators

2 Answers 60 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 07 Jun 2017, 12:34 AM

The check-spelling-as-you-type logic of RichTextBox treats multiple words separated by a non-space character (e.g., a comma or slash) as a single word. For example, me/myself gets underlined as shown on the attached picture (or here). Also note how a punctuation mark (e.g., a period) is included and underlined as a part of the word, e.g. for miiispelled. on the same picture.

I've investigated this a bit and it comes down to the fact that both "me/myself" and "miiispelled." are treated with a single SpanLayoutBox, which I believe is an atomic unit for underlining. Please correct me if I'm wrong.

Is this a bug or a "feature"? Is there any workarounds to make RichTextBox to interpret (and spell-check) such sequences of text as separate SpanLayoutBox objects?

Thank you.

2 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 07 Jun 2017, 02:26 AM

PS. Here's a very basic code to repro. Must reference: Telerik.Windows.Controls.dll, Telerik.Windows.Controls.Input.dll, Telerik.Windows.Controls.RichTextBoxUI.dll, Telerik.Windows.Documents.Proofing.dll, Telerik.Windows.Documents.Proofing.Dictionaries.En-US.dll:

 

private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
    var editor = new Telerik.Windows.Controls.RadRichTextBox
    {
        IsSpellCheckingEnabled = true,
        IsContextMenuEnabled = true
    };
 
    this.Content = editor;
 
    editor.InsertLineBreak();
    editor.Insert("this is meee/myself doing a test/check. A simple, miiispelled, plain word.");
}
0
Boby
Telerik team
answered on 07 Jun 2017, 02:35 PM
Hi Andrew,

This is definitely a bug, which we already have logged internally. The problem seems to be that different parts of the spell checking mechanism use different splitting of the text to words. and currently there is no workaround for this behavior. 

Following is the public item in our feedback portal, which you can use to track the item for eventual status changes:
RichTextBox: Spell checking underlines of incorrect words does not respect punctuation symbols

Please, excuse us for the inconvenience. Don't hesitate to contact us if you have other questions.

Regards,
Boby
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
RichTextBox
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Boby
Telerik team
Share this question
or