RadEditor Changes HTML element removes styles when using Toolbar Text-Align

9 posts, 0 answers
  1. Rambo the Dog
    Rambo the Dog avatar
    13 posts
    Member since:
    Feb 2010

    Posted 21 Jun 2011 Link to this post

    RadEditor Changes HTML Element markup and Style attributes when using Text-Align

    I've been beating my head against the wall for days only to find a potential bug in the editor.

    Put simply - loading certain formatted html elements into the RadEditor content area...and then using any of the Built in Text-Alignment buttons on the RadEditor toolbar wipes out the formatting and/or changes your html markup.

    And then the more you use the Text-Align feature the more div's get inserted each with a seperate style tag

    I've only outlined what it does in FF, darn thing is...if you let FF change the markup from <p> to <div> then save the data and load into an instance of RadEditor ContentAreaMode="Div" in IE..the modifed markup changes breaks the interface.

    I have a test project I can send that shows this behavior.

    Please advise

    Dan Thompson

  2. Rambo the Dog
    Rambo the Dog avatar
    13 posts
    Member since:
    Feb 2010

    Posted 22 Jun 2011 Link to this post

    ADDENDUM:

    I have a test project...or you can easily recreate this behavior using your own Demo

    http://demos.telerik.com/aspnet-ajax/editor/examples/contentareamodediv/defaultcs.aspx

    Load in FireFox 4.x...put your cursor on the text "RadEditor for ASP.NET AJAX" - hit any of the Text-Align buttons...RadEditor wipes out the formatting and replaces the markup.

    In iFrame mode..this does not happen.

    We are using the DIV mode, because we need a transparent background to the contentarea..which I have not been able to replicate using IFRAME mode.

    Please Advise!


  3. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 23 Jun 2011 Link to this post

    Hi Dan,

    Thank you for bringing this problem to our attention. I have logged it into our database and we will do our best to have it fixed for one of the upcoming releases. Here you can find the PITS Issue: Public URL

    Actually, this is a problem of the browser's default RichTextEditing engine - RadEditor is using the standard alignment commands. It is possible to implement a custom command to handle alignment tools but it will not be a trivial task. To do this you need to handle RadEditor's ClientCommandExecuting client-side event, cancel its default execution and implement the custom logic:
    <telerik:RadEditor ID="RadEditor1" runat="server" ContentAreaMode="Div"
        OnClientCommandExecuting="OnClientCommandExecuting">
    </telerik:RadEditor>
     
    <script type="text/javascript">
        function OnClientCommandExecuting(editor, args)
        {
            var commandName = args.get_commandName();
            if (commandName.indexOf("Justify") > -1)
            {
                args.set_cancel(true);//cancel default execution
     
                //add custom logic
            }
             
        }
    </script>


    As a small token of gratitude I have updated your Telerik points.

    All the best,
    Dobromir
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  4. Rambo the Dog
    Rambo the Dog avatar
    13 posts
    Member since:
    Feb 2010

    Posted 23 Jun 2011 Link to this post

    Dobromir,

    I appreciate your response.

    However,  I'd point you to this forum post - this has obviously been a known problem with your RadEditor control for nearly 2 years...
    FF insert <div> IE insert <p>

    Given this evidence, and my testing...I don't buy the argument that "its the Browser" causing the problem...if that were so, logic dictates RadEditor would also exhibit the same behavior in ContentAreaMode="iframe"...it doesn't. There is no loss of style of change in markup when aligning text using ContentAreaMode="iframe".

    Not having something as common, and to the end user - as simple - as aligning text reflects very poorly on your text editor controls capabilities..We've been a full suite Telerik shop for years - but, this RadEditor bug is very disappointing.and preventing us from releasing a new feature for our product right now.

    If all we get in response to a known bug in your product is "its the browsers fault" when it clearly doesn't appear to be - we may have to rethink our decision on using Telerik controls on any future projects.

    How long until we can expect to see a fix to this bug in production?

    Best regards

    Dan

    BTW: I've tried several of your competitors demo sites on FF, with the same formatting test, none exhibit the behavior of RadEditor.
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 24 Jun 2011 Link to this post

    Hi Dan,

    I believe I was not clear enough in my previous reply, and I would like to apologize for that.

    By stating "this is a problem of the browser's default RichTextEditing engine" I just wanted to point out that we are using the standard browser implementation of the Justify commands without any modifications, and not trying to put the blame on the browsers RTE. This is indeed a major fault in the ContentAreaMode="Div" implementation and as a problem related to the content editing we will consider as with very high priority issue.

    Unfortunately, I cannot provide a firm estimate on when this problem will be resolved, but we will do our best to issue it in one of service packs of RadControls for ASP.NET AJAX Q2 2011.

    Kind regards,
    Dobromir
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Rambo the Dog
    Rambo the Dog avatar
    13 posts
    Member since:
    Feb 2010

    Posted 27 Jun 2011 Link to this post

    Dobromir

    Thanks for the quick follow-up.

    We've had to turn to using iframe mode..but really need the div mode working to showcase our new product.

    For now we'll wait to see what you folks can do to get this fixed, before we make any decisions to pull the editor and replace it.

    Dan
  7. Rambo the Dog
    Rambo the Dog avatar
    13 posts
    Member since:
    Feb 2010

    Posted 27 Jun 2011 Link to this post

    Well, it's not looking too good for RadEditor...I've uncovered more FireFox bugs running RadEditor in ContentAreaMode="Iframe"
    I've verified this is an ongoing problem with RadEditor in our products and is easily re-creatable on your website demo.

    http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx

    Randomly trying Text-align seems ok..within a few minutes of playing around I found these bugs.

    • H1 doesnt text-align because of the underlying CSS class definition..this would seem like a bug to a normal end user..
    • Some <br/> are get replaced with <div> wrappers, altering the content display in IE..
    • Scroll to the very bottom of your sample content..you will see this..text...

    1.The computer language used to create world-wide-web pages which are read by browsers.

    Put your cursor on that text and try any text-alignment method on the Toolbar...it changes the display and acutally MOVES the text into a <div> outside of the <p> it was originally hosted in, that's just not right under ANY circumstances!!!!

    B4
    <br />
    <p style="border-top: 1px solid #555555; padding-top: 10px;">
    <sup><sup><a id="HTMLDescription">1.</a></sup>The computer language used to create world-wide-web pages which are read by browsers.</sup>
    </p>

    AFTER

    <br />
    <div style="text-align: center;">
    <sup><sup><a id="HTMLDescription">1.</a></sup>The computer language used to create world-wide-web pages which are read by browsers.</sup></div>
    <p style="border-top: 1px solid #555555; padding-top: 10px;">
    </p>

    It's really difficult to justify leaving RadEditor in our product...I really don't have much faith in your testing department or qa process if I can uncover so many bugs - in so short a time.

    Dan
  8. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 29 Jun 2011 Link to this post

    Hi Dan,

    Thank you for your continuous investigation on this issue. We greatly appreciate your effort in providing these scenarios. I will add them to the PITS item and we will handle them in the implementation of the Justify commands.

    Now regarding the problems:
    • H1 doesnt text-align because of the underlying CSS class definition..
      The current implementation of the Justify commands (browser's default) applies an align attribute to the heading tag, which is with lower priority than CSS declaration, that is why it is not visualized. RadEditor have a content filter (ConvertToXhtml) which transforms these attributes to inline style declarations, but it is not active in design view.
    • Some <br/> are get replaced with <div> wrappers, altering the content display in IE..
      Actually I believe this is the correct behavior. Text alignment cannot be applied to an inline element such as <br/> or <span>. The alignment need to be applied to a parent block element or if parent element is not present such should be inserted in the content. Which is the case with the RadEditor's default example.
    •  Scroll to the very bottom of your sample content..you will see this..text...
      This is indeed incorrect behavior, which seems to be caused by the <sup> elements wrapping the content, and we will handle it in the implementation.

    Again, this issue is with very high priority in our ToDo list and we will do our best to have it fixed as soon as possible.

    Kind regards,
    Dobromir
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  9. Rambo the Dog
    Rambo the Dog avatar
    13 posts
    Member since:
    Feb 2010

    Posted 05 Jul 2011 Link to this post

    Bottom line: These RadEditor bugs cost my client several thousand dollars and a missed ship date on a new feature.

    We just cannot wait around for a possible Telerik release to fix bugs that have been in your product for years.

    Within the last 3 days I replaced all RadEditor instances in our code with tinyMCE - things I spent weeks working around and debugging with RadEditor were simply a non-issue with tinyMCE...problem solved.

    This is a tough business - I hope you finally get RadEditor figured out someday along with a better QA/Testing process.

    Good luck!

    Dan



Back to Top