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

extra <br> added in Firefox when editor is hidden when loaded

4 Answers 40 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Trevor
Top achievements
Rank 1
Trevor asked on 08 May 2014, 02:16 AM
Discovered a problem on the latest editor, latest Firefox. If the editor is initially hidden when loaded, an extra <br> will be added to the existing content.

The behavior does not exist in Chrome or IE. The behavior does not exist in the previous version of the editor that we had (2012.2.724.40)

This is a significant problem for us.  Can you provide a solution?

Thanks,
Trevor.

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 May 2014, 05:11 AM
Hi Trevor,

Unfortunately I couldn't replicate the issue on latest telerik version of  RadEditor in latest FireFox. Please have a look into the sample code snippet which works fine at my end. Please provide a sample code where I can reproduce the issue for further help.

ASPX:
<telerik:RadEditor ID="radeditorHidden" runat="server" Visible="false">
</telerik:RadEditor>
<telerik:RadTextBox ID="radtxtCheckText" runat="server" Text="This is an exmaple line">
</telerik:RadTextBox>

Thanks,
Princy.
0
Trevor
Top achievements
Rank 1
answered on 08 May 2014, 05:48 PM
Hi,

I'll include the aspx file for a simple test that demonstrates the problem. It's not hard to reproduce and it is unfortunate I have to prepare a sample for you.

As I mentioned, this is a critical issue, since every time the user saves their content, another BR tag is added.  We can't unconditionally remove the BR tag because we have no way of knowing whether the user added it or the Editor added it.

Please provide a solution to this problem.

Thanks,
Trevor.


ASPX:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="TelerikTest.aspx.vb" Inherits="IronPoint.TelerikTest" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<html>
<body>
<form runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<h2>BR tag added when editor is initially hidden - Firefox only - editor version 2014.1.403.45</h2>
<h2>click button then switch to HTML mode - you will see a BR tag at the bottom</h2>
<div id="divWrapper" style="display:none">
<telerik:RadEditor runat="server" ID="RadEditor1">
    <Content>
        <p>this is line one</p>
        <p>this is line two</p>
        <p>this is line three</p>
        <p>this is line four</p>
    </Content>
</telerik:RadEditor>
</div>
<input type="button" onclick="document.getElementById('divWrapper').style.display='';" value="Show Editor" />
</form>
</body>
</html>

0
Accepted
Ianko
Telerik team
answered on 12 May 2014, 08:49 AM
Hello Trevor,

The mentioned behavior is encountered becuase of the initially hidden state and a logic in the RadEditor because of which the onParentNodeChanged() method is called automatically. 

This method has an already logged bug and I suggest following the public feedback portal item for a possible resolution.

Also, when it comes to programmatic showing and hiding of the Editor, it is recomended to use the repaint() method to fix layout issues. More about this is explained in this help article.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Trevor
Top achievements
Rank 1
answered on 15 May 2014, 01:19 PM
The suggested solution seems to have solved the problem for us.  Thank you.

Trevor.
Tags
Editor
Asked by
Trevor
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Trevor
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or