Unplanned
Last Updated: 14 Apr 2023 08:14 by ADMIN
Navid
Created on: 13 Apr 2023 08:33
Category: RichTextEditor
Type: Bug Report
1
RadRichTextEditor: The CurrentEditingStyle is not updated correctly when changing the font of long text
The CurrentEditingStyle is not updated correctly when changing the font of long text.
2 comments
ADMIN
Dimitar
Posted on: 14 Apr 2023 08:14

Hello Navid,

Thank you for adding the details here. Please note that we have detailed descriptions and a reference to the ticket internally as well. 

Do not hesitate to contact us if you have other questions.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Navid
Posted on: 14 Apr 2023 06:19

Issue description:

When trying to change the font for a lot of text the font is not correctly updated.

It seems that if the selected text is too long, the font property of the current editing style is not properly reflected.

I have this code to monitor and identify the issue:

private void radRichTextEditor1_CurrentEditingStyleChanged(object sender, EventArgs e)
        {
            var style = this.radRichTextEditor1.CurrentEditingStyle;

            this.CurrentFontLabel.Text = style.SpanProperties.FontFamily.ToString();
        }

private void ArialButton_Click(object sender, EventArgs e)
        {
            ChangeFont("Arial");
        }

private void ChangeFont(string fontName)
        {
            var font = new Telerik.WinControls.RichTextEditor.UI.FontFamily(fontName);
            this.radRichTextEditor1.ChangeFontFamily(font);
        }

Working scenario:

If the selected text is not very long when setting the font to 'Arial' with the button, the font reported in the CurrentEditingStyle.SpanProperties.FontFamily of the StyleChange event is correctly identified as 'Arial'.

Broken scenario:

If the selected text is too long when setting the font to 'Arial' with the button, the font reported in the CurrentEditingStyle.SpanProperties.FontFamily of the StyleChange event is incorrectly identified as 'Verdana'.

Reproduce:

In the attached WinForms solution:

  1. Set the text to a working text (that is NOT too long) with the 'Set working text' button (which also selects the inserted text).
  2. Set the font to 'Arial' with the 'Arial' button.
  3. Verify that the font is correctly updated in the label at the top.
  4. Set the text to a text that is too long with the 'Set tool long text' button.
  5. Set the font to 'Arial' with the 'Arial' button.
  6. Discover that the font is incorrectly updated in the label at the top.

Identified in Telerik version 2023.1.314.40 and 2022.1.118.40.

 

 

This makes it impossible to properly update the font of all text in the editor at once, when using a dropdown for the font, since the incorrectly updated 'Verdana' font would change it back due to the Change-events.

Attached Files: