Opened 17 years ago

Closed 17 years ago

#1005 closed Bug (fixed)

It isn't possible to insert a PlaceHolder in IE

Reported by: Alfonso Martínez de Lizarrondo Owned by: Martin Kou
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 (4)

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( '' ).

comment:3 Changed 17 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

I've replaced the current kludge with a kludge-upon-kludge in [618] which fixes this bug as well as the bug where empty blocks are not rendered. [618] is not perfect though, and I feel the correct approach to fixing this bug would be to investigate why it worked in 2.4.3 but not in the SVN version.

More investigation is needed.

comment:4 Changed 17 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [624]. Now the cursor position after inserting the placeholder is correct.

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