开发者

Click anywhere to focus in CKEditor

In FireFox, I can click anywhere in CKEditor (350px x 250px) to place focus on a single paragraph of text located at the top of the editor. However, in IE6 (I know, but our client insists) I must click directly atop the paragraph to 开发者_运维问答focus the cursor and subsequently edit the text.

CKEditor creates the following:

<iframe>
<html>
   <head>...</head>
   <body spellcheck="true">
      <p>some text to edit</p>
   </body>
</html>
</iframe>

I suspect this is an IE6 problem; any ideas???

EDIT: Apparently a known problem.


This is a known problem apparently fixed in v3.1.


I just had the same problem with the 4.2.2 release and IE 8 and was able to fix it with this code in the instanceReady event. It sets the focus when the user clicks anywhere in the CKEditor edit region.

CKEDITOR.on( 'instanceReady', function( ev ) {
    $('iframe.cke_wysiwyg_frame', ev.editor.container.$).contents().on('click', function() {
        ev.editor.focus();
    });
}); 


As the ticket date shows, the bug is still present, it hasn't been fixed in the 3.1 release.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜