CKEditor 3.5.2 become uneditable if parent container was hided in Iceweasel 3.5.16

Ya, the latest firefox is version 4.0 now. But I am using it as Iceweasel from Debian Squeeze apt repo, it's still 3.5.16. This issue do not happen in firefox 4.0, which I tested in a windows system.

So to reproduce this issue:
1. Have firefox 3.5.16
2. Create a ckeditor like below:

<script type="text/javascript" src="../ckeditor.js"></script>
<a href='#' onclick="document.getElementById('container').style.display= document.getElementById('container').style.display=='none'?'block':'none';">
<p id='container'>
<textarea class="ckeditor" class="editor1" cols="80" id="editor1" name="editor1" rows="10">
&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href=""&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;

3. The first time the page loaded, the editor has no problem to run. But if the link 'Toggle' clicked to hide and then display the editor, the editor will become uneditable. If at this point, click to switch editor from source mode to wysiwyg mode and then back, it will become editable again.

I have no idea why this happens, but anyway I found a bit ugly but tricky way to fix it:

<script language='javascript'>
CKEDITOR.on('instanceReady', function(e)
e. editor.on('focus', function(event)
if(CKEDITOR.env.gecko) //should locat the version to 3.5.16 or other possible ones
event.editor.setMode( 'source' );
event.editor.setMode( 'wysiwyg' )

This code will cause the editor to 'twinkling' on focus, and need to be improved also. So this is only a 'quick' fix. More research needed, and better the ckeditor team can investigate it to give a possible ckeditor layer fix if it's indeed a ckeditor bug.



Another way to workoraund this issue is call 'newpage' function instead toggle from wysiwyg to source and back.

Add new comment