Opened 6 years ago

Last modified 6 years ago

#8570 confirmed Bug

setReadOnly in combination with getSnapshot throws an error in IE

Reported by: Matt Owned by:
Priority: Normal Milestone:
Component: General Version: 3.6.1
Keywords: Cc:

Description

If you call setReadOnly and getSnapshot synchronously, an Error is thrown in IE (7-9, not tested in 10PP)

Reproduce:

  1. Go to http://ckeditor.com/demo
  2. Open the IE development tools
  3. Into the console, type in one line CKEDITOR.instances.editor1.setReadOnly(true); CKEDITOR.instances.editor1.getSnapshot();
  4. Hit enter
  5. An error occurs.

Working variation:

  1. Reload page
  2. Type into the console CKEDITOR.instances.editor1.setReadOnly(true);
  3. Hit enter
  4. Type CKEDITOR.instances.editor1.getSnapshot();
  5. Hit enter
  6. No error occurs

A workaround is to set readOnly first and do the rest of the work in a timeout.

Attachments (1)

8570.html (3.1 KB) - added by Jakub Ś 6 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 6 years ago by Jakub Ś

Status: newconfirmed
Version: 3.6.23.6.1

Reproducible in all versions of IE form CKEditor 3.6.1 rev [6965]

To reproduce just copy the attached file into samples folder and load it in IE.

JS error:
Message: 'this.$.innerHTML' is nul lor not an object
Line: 348
URI: /3.6.2/ckeditor/_source/core/dom/element.js

Changed 6 years ago by Jakub Ś

Attachment: 8570.html added

comment:2 Changed 6 years ago by Matt

I'm not sure if it the same problem, but in Firefox something similar happens. Instead of throwing an error, getSnapshot returns an empty string.

Same setting as in the description above, using Firefox 7.0.1

If I use CKEDITOR.instances.editor1.document.getBody().$.innerHTML, I get the correct data.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy