Opened 17 years ago

Last modified 17 years ago

#1005 closed Bug

It isn't possible to insert a PlaceHolder in IE — at Version 2

Reported by: Alfonso Martínez de Lizarrondo Owned by:
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: General Version: SVN (FCKeditor) - Retired
Keywords: Confirmed IE Cc: Frederico Caldeira Knabben

Description (last modified by Martin Kou)

This is a regression, 2.4.3 worked fine.

Load sample06.html in IE6, put the cursor inside some text and try to insert a PlaceHolder with any text, it just won't work.

Debugging it, the problem is in internals/fckdomrange_ie.js before the oIERange.pasteHTML('') ; in line 118 the body contains the empty span (and sometimes and extra   after or before it), but after it is executed the span is removed, so when it is returned to the plugin, the span isn't in the document and it won't be shown.

Change History (2)

comment:1 Changed 17 years ago by Martin Kou

I can see the oIERange.pasteHTML() line was only intended to delete the non-breaking space added just before it, but it seems to have a side effect of deleting the HTML node that was emptied by the action as well.

comment:2 Changed 17 years ago by Martin Kou

Description: modified (diff)

The comments says the logic block around that pasteHTML() line is a kludge for a browser bug. I don't know how to reproduce that bug though, so I were to apply a fix here now, I have no way to be certain whether my fix would make that bug appear again. My proposed fix is as follows:

if ( bIsCollapsed )
{
  oIERange.moveEnd( 'character', 1 ) ;
  oIERange.select() ;
  oIERange.collapse( true ) ;
  oIERange.select() ;
}

If this does not work, how about this... instead of pasting a non-breaking space to expand the block in the try {...} block, we paste a <span> with a unique id there. Then we use DOM methods to remove it instead of using pasteHTML( '' ).

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy