Custom RemoveElementTool crashes IE.

8 posts, 0 answers
  1. Alien Interactive AB
    Alien Interactive AB avatar
    23 posts
    Member since:
    Jul 2004

    Posted 05 Sep 2017 Link to this post

    Hi,

    We have a custom tool in the editor to remove "comments", this works when I simulate IE 7 and works great in Chrome. When I click the button in IE 10 the browser crashes without any details. 

    If I debug the code it seems like it is working, the crash seems to happen in RadEditor.js when the checkElementsRecursively() is done. 

    Do you have any clue whats happend? I guess it has to do with the removed element.

    sb.Append("Telerik.Web.UI.Editor.CommandList[\"StripOneSpan\"] = function(commandName, editor, args){");
    sb.Append("var theSelectedElement = editor.getSelectedElement();");
    sb.Append("checkElementsRecursively(theSelectedElement)");
    sb.Append("};");

     

    And the JS-code: 

            function checkElementsRecursively(selElement) {

                if ((selElement.tagName == "FONT" || selElement.tagName == "font" || selElement.tagName == "SPAN" || selElement.tagName == "span") && selElement.attributes["id"] != null && selElement.attributes["id"].value.substring(7, 0) == "abccom_" && selElement.parentNode != null) {
                    selElement.parentNode.removeChild(selElement);
                }
            }

  2. Rumen
    Admin
    Rumen avatar
    14100 posts

    Posted 08 Sep 2017 Link to this post

    Hello,

    I tried to reproduce the problem but without success as shown at https://www.screencast.com/t/Pb8qg7JeoLZ

    Do you experience the problem with the latest version 2017.2.711?

    What's your version of IE10?

    Best regards,
    Rumen
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Alien Interactive AB
    Alien Interactive AB avatar
    23 posts
    Member since:
    Jul 2004

    Posted 11 Sep 2017 in reply to Rumen Link to this post

    Hi, thanks for your reply!

    The two versions of IE i tried with is:

    IE 10 (10.0.9200.16521)
    IE 11 (11.0.9600.18763) (in IE 10 mode)

    And Telerik versions:
    2017.2.711
    2015.1.401.45

    If I remove this line of code everything works great. And if I debug past the line it also works. 

    selElement.parentNode.removeChild(selElement);
  4. Rumen
    Admin
    Rumen avatar
    14100 posts

    Posted 13 Sep 2017 Link to this post

    Hi there,

     

    I would suggest an improvement in the parent element node check:

     

    replace selElement.parentNode != null

    with selElement.parentNode:

     

    function checkElementsRecursively(selElement) {
                if ((selElement.tagName == "FONT" || selElement.tagName == "font" || selElement.tagName == "SPAN" || selElement.tagName == "span") && selElement.attributes["id"] != null && selElement.attributes["id"].value.substring(7, 0) == "abccom_" && selElement.parentNode) {
                    selElement.parentNode.removeChild(selElement);
                }
            }

     

     

    This should do the trick.

     

    Regards,

    Rumen

    Progress Telerik

    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Alien Interactive AB
    Alien Interactive AB avatar
    23 posts
    Member since:
    Jul 2004

    Posted 13 Sep 2017 in reply to Rumen Link to this post

    This is really strange...

    from computer #1 with IE 10 and Telerik version 2015.1.401.45 it works now without any changes to the code. (reproduced the issue several times before.)

    Computer #2 IE 11 and Telerik version 2015.1.401.45, it doesnt work

    Computer #3 IE 11 and Telerik version 2015.1.401.45, it doesnt work, with version 2017.2.711 it works now..

    I tried your suggestion with computer #2 and it does not work.

  6. Rumen
    Admin
    Rumen avatar
    14100 posts

    Posted 13 Sep 2017 Link to this post

    Unfortunately I am also unable to replicate the issue on my end.

    Can it be an IE compatibility issue? Can you check whether the page is rendered in native IE mode inside the emulator tab of the IE dev console?

    Best regards,

    Rumen
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Alien Interactive AB
    Alien Interactive AB avatar
    23 posts
    Member since:
    Jul 2004

    Posted 14 Sep 2017 in reply to Rumen Link to this post

    Ok, 

    On both computer #1, #2 it is: IE 10 compatibility mode (think this is set by the clients IT department where we got the computers from) the strange thing is that it was not working on #1 from the beginning, that feels like som client-issue if it works now? Dont really know what it should be looking for. 

  8. Rumen
    Admin
    Rumen avatar
    14100 posts

    Posted 14 Sep 2017 Link to this post

    I am really sorry but IE compatibility mode is not supported since it forces the page to be rendered in IE7 mode. This information is available in the Browser Support page.

    Regarding this you have two options:
    - try to force native mode with the following meta tag: 
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    as suggested here.

    - ask the administrators to force native mode, if the network policy overrides the meta tag setting.

    Regards,
    Rumen
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top