Click anywhere to focus in CKEditor

时光毁灭记忆、已成空白 提交于 2019-12-11 00:48:24

问题


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.


回答1:


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




回答2:


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();
    });
}); 



回答3:


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



来源:https://stackoverflow.com/questions/2028599/click-anywhere-to-focus-in-ckeditor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!