Malthe Borch | 12 Jul 16:19
Picon
Gravatar

Re: IE 8 insert issue with Kupu

Caroline Sturtridge <caroline <at> domus.net> writes:

> 
> 
>     Hi,
>       I know this is a long shot, but we have a system that uses the
>       Kupu editor that works fine in IE 7 but in IE 8 if you try to
>       insert anything it gets inserted at the top of the document,
>       rather than where the cursor is.  
>       I know this was reported as a bug 
(http://dev.plone.org/old/plone/ticket/9491)
>       but as development on Kupu has stopped and I don't understand the
>       workaround I was wondering if anyone who was still subscribed to
>       this list might be able to give me some further information on the
>       workaround or suggest an alternative fix?

I have played around with this issue and found that the iframe (which holds the 
content that's editable) needs to be focused before the caret position can be 
properly read. This has changed in IE8 which is why you're seeing the behavior 
only in this browser.

Prepending the following to the ``IESelection`` function fixes the issue:

 function IESelection(document) {
    document.editable.focus();
    ...

However, it's not really a great fix because this seems to do a "hard focus" on 
the iframe which actually centers the browser on the iframe as a side-effect.

(Continue reading)


Gmane