Opened 8 years ago
#16947 new Bug
Destroy CKEditor on Focus transfer - Error in Chrome
Reported by: | pfassev | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.6.2 |
Keywords: | Cc: |
Description
Steps to reproduce
- Create CKEditor "editor" to replace a text area with name="editor" and 2. Add additionaly a simple Input Field "input1" <input type="text" name="input1" id="input1">
- register a focus listener to the input1 field. onfocus deaktivate the ckeditor with onfocus="CKEDITOR.instanceseditor?.destroy()";
- Klick into the ckeditor to get the focus
- Then klick into the 'input1' text field
Expected result
The ckeditor will be deaktivated.
Actually on our real page we want on focus lost to disable the ckeditor and display the value in a separate div. Probably we could atchive this also with an inline editor, but neverthels, there is a problem with the current solution. It occures only in Chrome, but not in Firefox, Edge or IE.
Actual result
JavaScript Error in Chrome: ckeditor.js:238 Uncaught TypeError: Cannot read property 'isInline' of null
at CKEDITOR.focusManager.d (ckeditor.js:238) at CKEDITOR.focusManager.<anonymous> (ckeditor.js:238) at ckeditor.js:28
Other details (browser, OS, CKEditor version, installed plugins)
The error occures wi the newes CKEditor Version 4.6.2 currently in the newes Chrome Version (57.0.2987.98 (64-bit)) under Windows 10:
The problem is due to a check for chrome and isInline in the following line 238 of our ckeditor.js:
this.hasFocus&&(this.hasFocus=!1,CKEDITOR.env.chrome&&a.editable().isInline()&&a.window.$.getSelection().removeAllRanges()