Completed
Last Updated: 28 Jan 2025 19:08 by ADMIN
B
Created on: 23 Jan 2025 15:22
Category: Editor
Type: Bug Report
0
Unexpected New Line Insertion When Pressing Enter After Making Text Bold in Telerik Rad Editor

I am experiencing an issue in the Telerik Rad Editor where, after copying and pasting a long sentence in a single line, if I apply bold formatting to a word and place the cursor at the beginning of the bolded word, pressing Enter results in an empty line being inserted between the text. This behavior is reproducible on the Telerik webforms editor demo site as well.

I would appreciate any guidance on how to resolve this issue. Thanks in advance.

3 comments
ADMIN
Rumen
Posted on: 28 Jan 2025 19:08

Hi,

After additional research, I'd like to clarify that this is not a real bug but rather a browser behavior. The browser renders the ​ character (used as a special placeholder for cursor positioning in the internal logic of the editor's InsertParagraphCommand) on a new line when the text exceeds the width of the content area.

Please note the following:

  • The ​ character does not get saved into the database.
  • RadEditor automatically removes this special character when submitting content, as well as when switching between the HTML, Design, and Preview modes.

Optional Workaround
If you prefer to avoid this behavior altogether, you can override the internal setCursor method of the InsertParagraphCommand to prevent the ​ from being rendered. Below is an example of how you can achieve this:

        <script>
            Telerik.Web.UI.Editor.InsertParagraphCommand.prototype.setCursor = function (container, cursor) {
                var editor = this.get_editor();
                var nextSibling = cursor.nextSibling;
                
                // Remove the cursor placeholder node
                cursor.parentNode.removeChild(cursor);

                var range = this.domRange;

                // Default: place the cursor at the start of the container or before the next sibling
                range.setStart(container, 0);


                range.collapse(true);
                range.select();
            }
        </script>
        <telerik:RadEditor runat="server" ID="RadEditor1" Height="600px">
            <Content>aaaaa<strong>test</strong>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<br>aa<strong>aaaaaa</strong>aaaa</Content>
            <Modules>
                <telerik:EditorModule Name="RadEditorStatistics" Visible="true" />
                <telerik:EditorModule Name="RadEditorDomInspector" Visible="true" />
                <telerik:EditorModule Name="RadEditorNodeInspector" Visible="false" />
                <telerik:EditorModule Name="RadEditorHtmlInspector" Visible="true" />
            </Modules>
        </telerik:RadEditor>
I hope this addresses your concern effectively.

 

 

Regards,
Rumen
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
B
Posted on: 28 Jan 2025 10:21

Thank you for your response, Rumen. This issue was raised by one of our customers, and resolving it is quite important for them. Would it be possible to provide an estimated timeline for when we might expect a fix or any further updates on this?

Thank you again for your support.

ADMIN
Rumen
Posted on: 23 Jan 2025 16:26

Thank you for bringing this issue to our attention! I have converted your forum post into a bug report for our team to investigate further.

At the moment, there is no available workaround for this scenario. However, it’s worth noting that using such a long content to edit is not a very common approach, which may explain why this issue hasn’t surfaced before.

As a token of our appreciation for your valuable feedback, I’ve credited your account with 1,000 Telerik points. Thank you for helping us improve our products!

 

Regards,
Rumen
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources