Opened 8 years ago

Closed 8 years ago

#14809 closed Bug (fixed)

Divarea: Calling insertElement() in Edge before clicking into editor gives error

Reported by: Mark Wade Owned by:
Priority: Normal Milestone:
Component: General Version: 4.5.2
Keywords: Edge Cc:

Description (last modified by Jakub Ś)

Steps to reproduce

  1. Download the attached file, and edit line 6 to point to correct CKEditor path which has the "Div Editing Area" plugin enabled
  2. Load it in the latest version of Edge
  3. Click the "Click Me" button.

Expected result

"Hello, World!" appears inside the editor

Actual result

The contents of the editor do not change, and the following error is logged to the console:

SCRIPT5007: Unable to get property 'checkReadOnly' of undefined or null reference

Other details (browser, OS, CKEditor version, installed plugins)

Seems to happen when calling insertElement() before the user has clicked into the editor (this is common in our usage, as we have a "Quote" button next to all posts, which initiates an editor and then inserts the quoted post into it).

Happens in the latest version of Edge (38) but doesn't happen in older versions (14 is the latest available on Browser Stack and it doesn't happen there - but it seems to be the most recent update as this issue has only recently been reported to us) or in any other browser.

Does not happen unless the Div Editing Area plugin is present.

Bug report in our system: https://invisionpower.com/4bugtrack/active-reports/41132-edge-wont-quote-a-post-r12195/

Attachments (1)

ckeditor-test.html (756 bytes) - added by Jakub Ś 8 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 8 years ago by Jakub Ś

Description: modified (diff)
Keywords: Edge added
Status: newconfirmed
Summary: Calling insertElement() in Edge before clicking into editor gives errorDivarea: Calling insertElement() in Edge before clicking into editor gives error
Version: 4.5.10 (GitHub - master)4.5.2

Does not happen unless the Div Editing Area plugin is present.

Your sample doesn't include divarea plugin. I needed to update it.

Support for Edge was first introduced in CKEditor 4.5.2 so this is the version I'm setting as a starting point although problem occurs before that version as well.

Since this issue doesn't happen once you click into editor, I thought that below 'if' could solve the problem but error is thrown despite putting focus into editor.

e.preventDefault();
if( !editor.focusManager.hasFocus )
	editor.focus();
editor.insertHtml('<p>Hello, World!</p>');

Changed 8 years ago by Jakub Ś

Attachment: ckeditor-test.html added

comment:2 Changed 8 years ago by Jakub Ś

Similar issues with 'checkReadOnly' can also be found in: #13314, #13620

comment:3 Changed 8 years ago by kkrzton

I did a small investigation as I was not able to reproduce this issue in CKEditor 4.5.11. It seems this error was fixed in this release. I believe it was fixed by this patch - #14825, as we switched from using setActive to focus method while focusing editor for the newest Edge.

@j.swiderski I would ask you to confirm this before we take further steps regarding this issue.

comment:4 Changed 8 years ago by Jakub Ś

Resolution: fixed
Status: confirmedclosed

I could not reproduce this issue as well. I'm marking it as fixed.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy