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

Custom RemoveElementTool crashes IE.

7 Answers 18 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alien Interactive AB
Top achievements
Rank 1
Alien Interactive AB asked on 05 Sep 2017, 01:45 PM

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);
            }
        }

7 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 08 Sep 2017, 03:13 PM
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.
0
Alien Interactive AB
Top achievements
Rank 1
answered on 11 Sep 2017, 07:44 AM

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);
0
Rumen
Telerik team
answered on 13 Sep 2017, 08:51 AM

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.
0
Alien Interactive AB
Top achievements
Rank 1
answered on 13 Sep 2017, 01:18 PM

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.

0
Rumen
Telerik team
answered on 13 Sep 2017, 03:57 PM

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.
0
Alien Interactive AB
Top achievements
Rank 1
answered on 14 Sep 2017, 12:17 PM

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. 

0
Rumen
Telerik team
answered on 14 Sep 2017, 12:55 PM
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.
Tags
Editor
Asked by
Alien Interactive AB
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Alien Interactive AB
Top achievements
Rank 1
Share this question
or