Completed
Last Updated: 10 Apr 2019 15:41 by ADMIN
Nick
Created on: 14 Mar 2019 13:21
Category: UI for ASP.NET AJAX
Type: Bug Report
0
onParentNodeChanged() causes an Cannot read property 'defaultView' of undefined error in Chrome 73

This can be reproduced with the following sample:

<telerik:RadWindow runat="server" ID="RadWindowWithEditor" Height="1000px" OnClientShow="fixEditor"
 
    OpenerElementID="Button5">
    <ContentTemplate>
        <telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" Width="700px" Height="700px">
            <Content>
Lorem ipsum dolor sit amet
            </Content>
        </telerik:RadEditor>
    </ContentTemplate>
</telerik:RadWindow>
<asp:Button ID="Button5" Text="open the RadWindow" runat="server" />
<script type="text/javascript">
    function fixEditor() {
        setTimeout(function () {
            $find("<%=RadEditor1.ClientID %>").onParentNodeChanged();
        }, 100);
    }
</script>

 

16 comments
ADMIN
Rumen
Posted on: 10 Apr 2019 15:36
Hi Rajiv,

I am unable to repro this issue, but anyway it is not related to the feedback bug report item.

Please let's continue the communication is an appropriate support channel for technical assistance: in the Telerik AJAX forums or a support ticket.

Please isolate the problem in a simplified runnable page or project and send it for examination.

On a side note, if the toolbar reappears properly when the set_useClassicDialogs is called and you are OK with its appearance, you can use this as a workaround. The purpose of is to replace RadWindow with the browser window dialog as explained at Using browser modal dialog instead of RadWindow.

The only reason to fire this method is to prevent the popup blocking of your browser, but I haven't faced such an issue from years.
 

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Rajiv
Posted on: 10 Apr 2019 15:06

Thanks for your reply.

But Rumen its not working for me.

Actually the issue is at this line of code editor.set_useClassicDialogs(true);

While i set it to false its working fine but when it is true toolbar not coming.

 

Thanks.

 

 

ADMIN
Rumen
Posted on: 09 Apr 2019 14:59
Hi Rajiv,

I noticed that you are using a customized the solution from https://www.telerik.com/support/kb/aspnet-ajax/details/setting-hidden-radeditor-in-edit-mode-on-click-and-putting-it-in-non-editable-mode-onblur and now the code throws the 

Cannot read property 'getElementsByTagName' of null error, due to this line: 

var editorIframe = $get(editor.get_id() + "Wrapper").getElementsByTagName("iframe")[0];

You can obtain the editor's Iframe content area element with this API code:

var editorIframe = editor.get_contentAreaElement();

You can also use the attach the key event to the content area using the attachEventHandler method of the editor:

editor.attachEventHandler("onkeydown", function (e) { alert("Content area key down " + e.keyCode); });

Also set the RadEditor's ToolbarMode="ShowOnFocus" and try again.

On a side note, please use the support ticketing system or the forums for any technical communications. Right now the reported issue is neither related to the original bug report, nor a bug in the control and the feedback portal is not suitable source for researching it.

Thank you for your understanding!

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Rajiv
Posted on: 09 Apr 2019 13:11

Hi Rumen,

 

Any update on below post?

If you need anything else then please let me know.

 

Thanks

Rajiv
Posted on: 04 Apr 2019 11:51

Hi Rumen,

 

I found one more issue in rad editor after taking latest version 2018.2.710.45 telerik dll.

While i trying to upload any image from rad editor tools and second time trying to edit the editor,Editor tools not coming.

 It was working fine in version 2013.2.717.45 but it is not working in 2018.2.710.45(which i upgrade) and also not working with latest version 2019.1.215.

I am not getting any console error.

 

I f you have any hot fix then please provide me ASAP.

 

I am attaching page, you can reproduce it.

Steps to reproduce

1.double click on textbox, it will be edited and rad tools will come on the top

2.try to add image from tools(insert/cancel from popup).

3.click outside the textbox onse or twice.

4.again double click on textbox it will be edited but tools is not coming.

 

Thanks.

Attached Files:
ADMIN
Rumen
Posted on: 02 Apr 2019 07:20
You are welcome, Rajiv! Keep the good work.

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Rajiv
Posted on: 02 Apr 2019 07:10

 

Thanks Rumen.

 

Now error gone.

 

Thank you so much..

ADMIN
Rumen
Posted on: 01 Apr 2019 15:46
Hi Rajiv,

Thank you very much for the sample file!

I managed to reproduce the "Cannot read property 'selection' of undefined" error even with a version from 2015. The bug is not related to the one reported in this bug report item and can be fixed by calling the set_html() method with a small timeout:

setTimeout(function () {
    editor.set_html(target.innerHTML);
}, 100);


Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Rajiv
Posted on: 01 Apr 2019 13:39

Hi Rumen,

Thanks for your valuable reply.

I am attaching one file please check this.

While you double click on any editor then you will get the error first time only.

 

Thank You.

Attached Files:
ADMIN
Rumen
Posted on: 01 Apr 2019 10:43
Hi Rajiv,

I am still unable to repro the issue. Can you please see the attached video and test the attached page and let me know what I am missing?

Can you please modify the test page Default2.aspx so that it exhibits the problem and send it back for examination?

Thank you very much!

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files:
Rajiv
Posted on: 27 Mar 2019 07:33

Hi Admin,

 

Basically i am getting error in chrome  while executing below line of code

editor.set_html("");

 

It is working fine in Firefox.

Rajiv
Posted on: 26 Mar 2019 15:26

Hi,

I downloaded hot fix build Telerik_UI_for_ASP.NET_AJAX_2019_1_318_Trial_hotfix.zip and add dll in my project.

But still i am getting same error message in consol. It does not affect my application but why i am getting this error.

 

As i told you earlier that some design affected. for example radeditor height became small which is in iframe.

 

Earlier iframe style was height:100% and width:100%

Now iframe style was height:35px and width:100%

 

 

If you have any idea then please let me know.

 

I am trying to give you a demo solution project.


Attached Files:
ADMIN
Rumen
Posted on: 26 Mar 2019 14:17
Hi Rajiv,

Can you please go to https://www.telerik.com/account/product-download?product=RCAJAX -> click on the Internal Builds tab and download -> Telerik_UI_for_ASP.NET_AJAX_2019_1_318_Trial_hotfix.zip?

After that update your application with it and see whether the newly "Cannot read property 'selection' of undefined" reported error still persists.

If it is there, please provide a simple runnable project which reproduces the error so that I can debug it. Thank you!

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Rajiv
Posted on: 26 Mar 2019 13:06

Hi,

i was also getting the same issue but after using your provided scripts this errors gone now its working fine except small design  issue.(i.e radeditor height becomes small).

Now i am getting new error message

"Cannot read property 'selection' of undefined".

 

Can you please provide any solution for new  error. Why i am getting this error.

 

I am using radeditor in iframe.

Attached Files:
ADMIN
Rumen
Posted on: 18 Mar 2019 12:41
Hi All,

I have good news that the problem was fixed in the Latest Internal Build (Telerik_UI_for_ASP.NET_AJAX_2019_1_318_Dev_hotfix.zip) which you can download from your account https://www.telerik.com/account/product-download?product=RCAJAX -> Internal Builds as shown in the attached screenshot.

We do respect your feedback so please test it and let us know if you find any side effects with it!

Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files:
ADMIN
Rumen
Posted on: 14 Mar 2019 13:25
Hi Nick,

Thank you for reporting this Chrome 73 regression.

We will fix the problem in the upcoming R2 2019 version of the controls. Right now you can solve it with the following function override:

<script type="text/javascript">
 
    Telerik.Web.UI.Editor.Utils.isWindowDestroyed = function (window) {
        var doc;
        try{
            doc = window.document;
        catch (e) {
            return true;
        }
        if (!doc) {
            return true;
        }
        return !doc.defaultView && !doc.parentWindow;
    }

Here is a complete sample which works properly on my side in Chrome 73:

  <telerik:RadWindow  runat="server" ID="RadWindowWithEditor" Height="1000px" OnClientShow="fixEditor"
    OpenerElementID="Button5">
    <ContentTemplate>
        <telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" Width="700px" Height="700px">
            <Content>
                Lorem ipsum dolor sit amet
            </Content>
        </telerik:RadEditor>
    </ContentTemplate>
</telerik:RadWindow>
<asp:Button ID="Button5" Text="open the RadWindow" runat="server" />
<script type="text/javascript">
 
    Telerik.Web.UI.Editor.Utils.isWindowDestroyed = function (window) {
        var doc;
        try{
            doc = window.document;
        catch (e) {
            return true;
        }
        if (!doc) {
            return true;
        }
        return !doc.defaultView && !doc.parentWindow;
    }
 
    function fixEditor()
    {
            $find("<%=RadEditor1.ClientID %>").onParentNodeChanged();
    }
    </script>

As a small note of gratitude for reporting the issue I updated your Telerik points.

Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.