I need to be able to insert HTML into the current (last known) cursor position inside a ckeditor instance. The catch is, that the instance is currently hidden (display: none).
This worked fine in ckeditor < 4.0 but since then stopped working.
I reported the Problem I'm encountering http://dev.ckeditor.com/ticket/10402 and my only attempt at a workaround is triggering yet another bug: http://dev.ckeditor.com/ticket/10402.
I also tried to use createBookmark but I am unable to find an Event/Hook to call it from. on('blur') does not work and calling it on selectionChange (ya, ya, I know - but I am desperate) results in a lot of garbage spans and rather shitty editing performance.
Any suggestion on how to workaround those problems?
The workaround for this would
The workaround for this would be a solution for the ticket in fact. We already use bunch of hacks to save selection before editor is blurred - surprisingly on FF something very special happens when editor is hidden - I don't know what unfortunately.
Anyway, you can try the editor#selectionCheck event (see selection.js for some details). We use it to update last selection which we then lock when editable is blurred. Bookmarks won't help you and note that on blur the selection may be already gone (what's a real reason of all these hacks). So I'm afraid that it could be very hard to write even partially working solution.
PS. Why do you hide editor? Maybe it's better to move it out of the viewport?
PPS. Do not change the sctructure of DOM.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
> PS. Why do you hide editor?
> PS. Why do you hide editor? Maybe it's better to move it out of the viewport?
Thanks. That was exactly the hint I was hoping for. Moving the editor instead of hiding it works.