I have CKEditor loaded in a hidden (display: none) element on the page, but when the page loads I get the following error:
Error: r is null
Source File: http://localhost/test/js/ckeditor/ckeditor.js
Line: 122
If I remove the 'display: none' from the page the editor seems to load without any problems (but is displayed ruining the initial page). Since the code required is generated by PHP there is not much I can change to remove this error I think. Therefore I hope someone here has any clue on how to fix this. Thanks in advance.
Sat, 11/06/2010 - 16:52
#1
Re: CKEditor in hidden element (bug?)
a plugin ?
jquery pagination ?
Re: CKEditor in hidden element (bug?)
It only seems to happen when CKEditor is in a hidden tab and has no content set.
Our workaround was to populate any emply instances of CKEditor that were in a tabbed interface with an empty paragraph, eg
Hope this helps.
Re: CKEditor in hidden element (bug?)
Sorry, I'm still learning my way around CKEditor, and I am having this same issue.
How did you populate the empty instances?
Re: CKEditor in hidden element (bug?)
We wrote a .NET wrapper that handled the implementation, probably not exactly what you need.
But you could do something similar in jQuery or PHP, just check the value of the textarea before you run the CKEditor.replace method, if the value is empty, then insert the empty paragraph.
In jQuery:
Its not hugely sophisticated, but it works!
Re: CKEditor in hidden element (bug?)
Even just:
<textarea name="editorBody">dummytxt</textarea>
Thank you psykoptic
Re: CKEditor in hidden element (bug?)
I think that what will be necessary is to NOT try to ckeditor.replace a hidden textarea at all. But then, the action/button/link which reveals the hidden one will need to have an onclick that triggers the ckeditor.replace function. Which means you have to write it as a triggerable function in the first place. Nasty workaround, but several days of searching hasn't turned up any other fix.
Hope there's a better way, soon.