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

[Solved] backspace triggers all empty lines to be removed

1 Answer 100 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Roberto Plascencia
Top achievements
Rank 1
Roberto Plascencia asked on 06 Nov 2009, 01:02 AM
On Mozilla 3.0.15 with the latest version of radEditor, after typing 3 lines each with an empty line in between (total of 5 lines), if there is a backspace at the start of the 3rd line, the expected behavior is to remove the second line (empty line), but instead both empty lines (2nd and 4th) are removed.
ex.

L1

L2

L3

expected result is:
L1
L2

L3

instead we get:
L1
L2
L3

you can recreate this scenario by pasting the lines bellow,  on your demo http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx (remove the current text and paste in HTML mode), go to design mode and position the cursor before t2 then hit backspace, you will see that the 2nd and 4th line will be removed, I would like to know if there is any work around, I suspect that there might be a Regular expression that needs a little adjustment. Please advice on possible work around/fix. Thanks

<p style="" quad="L" br="false">t1</p>

<br /><p style="" quad="L" br="false">t2</p>

<br /><p style="" quad="L" br="false">t3</p>

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 11 Nov 2009, 08:18 AM
Hi Roberto,

The observed behavior is due to the Rich Text Editing engine of Firefox that RadEditor uses. When you put the cursor at the start of the third line and hit the backspace button then not only the <br> tag is deleted but also the wrapping <p> tag. You can reproduce the same behavior with a standard IFRAME element (test the attached page) as well as with our competitors' editors. You can verify that this is a browser behavior by testing the same scenario in IE and you will see that only the <br> tag will be deleted.

Since this is a browser behavior it will be hard or impossible to provide a solution, because it could appear unwanted side effects.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Roberto Plascencia
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or