Unplanned
Last Updated: 06 Feb 2018 13:56 by ADMIN
ADMIN
Tanya
Created on: 06 Feb 2018 13:54
Category: RichTextBox
Type: Bug Report
0
RichTextBox: Layout updates stop after deleting paragraph containing space between two tables
Pressing Delete at the end of a paragraph leads to merging the content of the current paragraph with the next block. However, when the deleted paragraph contains a single space, the layout stops updating after pressing Delete.

Steps to reproduce:

1. Create two tables with paragraph between them

2. Add a space to the paragraph

3. Press Delete (when the caret is just after the space)

Observed: The layout is not updated after this and further modifications


Workaround: 
Delete the space before deleting the paragraph:

private void RadRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
    if (e.Command is DeleteCommand && this.radRichTextBox.Document.Selection.IsEmpty)
    {
        Paragraph currentParagraph = this.radRichTextBox.Document.CaretPosition.GetCurrentParagraphBox().AssociatedParagraph;
        if (currentParagraph.Inlines.Count==1 && string.IsNullOrWhiteSpace((currentParagraph.Inlines.First as Span).Text))
        {
            this.radRichTextBox.Delete(true);
        }
    }
}

0 comments